Well, of course Steven Spielberg’s history lesson about the abolition of slavery is entertaining, big-hearted, and soul-stirring. With its clear-cut moral issues and patriotic significance, “Lincoln” is right in Spielberg’s wheelhouse, and Daniel Day-Lewis’ warmly captivating lead performance is a perfect fit. The title is wrong, though, as this is less a biography of the 16th president than the story of how the slavery-ending Thirteenth Amendment was passed in the final days of the Civil War, and all the political wrangling that went into it. Lincoln’s secretary of state, William Seward (David Strathairn), plays a crucial part, as does Thaddeus Stevens (Tommy Lee Jones), a tart-tongued Republican congressman in an awful wig who is bluntly opposed to slavery on moral grounds but is able to help sell Democrats on the bill by focusing on legal principles: “equality before the law.” Parallels to modern politics are easy to see but not underlined; apart from the Washington wheeling and dealing, which has a “West Wing”-like appeal of its own, you can enjoy “Lincoln” purely as a great story full of drama.

And comedy: the film is surprisingly funny. Written by Tony Kushner (“Angels in America,” “Munich”), based in part on Doris Kearns Goodwin’s book “Team of Rivals,” the screenplay gives Tommy Lee Jones ample opportunity to demonstrate his gift for verbal abuse, with Stevens throwing around insults like “fatuous nincompoop” as he keeps his Republican brethren in line. James Spader, Tim Blake Nelson, and John Hawkes play a lively trio of lobbyists brought in by Seward to secure Democrat votes by offering favors from the administration. Not only is their conniving funny, it helps us relate more intimately to the story: politics was a sleazy game then, too! The people in our textbooks were just like us!

Lincoln was a humorous man too, which Day-Lewis captures as immaculately as everything else in his performance. The president has a commanding presence, captivating every time he speaks, by turns folksy, gentle, jocular, and grandiose. His odd sense of humor goes over people’s heads sometimes; other times he’ll tell a joke and nail it. Kushner’s screenplay doesn’t limit itself to the official record of what Lincoln and his associates are known to have said, but it manufactures dialogue for them that feels authentic.

As far as I’m concerned, the movie has two flaws. One is the opening sequence, in which Lincoln visits soldiers who recite the Gettysburg Address to him. That’s hokey, and not at all representative of the rest of the movie, which is smart and doesn’t pander. The other is Lincoln’s oldest son, Robert (Joseph Gordon-Levitt), who’s given nothing significant to do and contributes little to the main story. In a similar vein, though Sally Field gives a more sympathetic portrayal of Mary Todd Lincoln than we’re used to seeing, there’s no emotional connection between the audience and her, her husband, and their children. When “Lincoln” focuses on the political, social, and historical side of things — which is 80% of the film — it’s grand, populist, high-minded entertainment.

B+ (2 hrs., 29 min.; PG-13, moderate profanity including an F-word, and images of war carnage.)