The task of encapsulating the essence of Abraham Lincoln in a single film took Steven Spielberg roughly three times as long as it took the 16th president to win the Civil War, abolish slavery and put the country on the course to recovery.

Creating such a historical epic may not compare to the colossal task of saving a bloodily divided nation. But by Hollywood standards, “Lincoln” is as monumental as it gets, even for a couple of multiple Academy Award winners as Spielberg and the man he chose to play the president, Daniel Day-Lewis.

Born in Britain, Day-Lewis had to think about Lincoln not only as a towering historical figure, but also as a foreign statesman whose portrayal would be a sensitive matter for U.S. audiences that revere the president.

“Because of the nature of the iconography surrounding his life and the extent to which he is mythologized and carved in stone, it’s very difficult to imagine that one could ever approach him, to get close enough,” Day-Lewis said in a recent interview alongside Spielberg.

“I was very shy about the idea of taking on this. Plus, I like working here. I’ve been tremendously privileged in being able to work in this country over the years. The idea of desecrating the memory of the most-beloved president this country has ever known was just kind of a fearful thing to me,” said Day-Lewis, who earned best-actor Oscars for “My Left Foot” and “There Will Be Blood.”

Spielberg long had considered a film about Lincoln. He did not want to tell the whole life story, from Lincoln’s rail-splitting days as a youth to his assassination right after the war ended.

He also did not want to make a Civil War film loaded with grand battles or tell the story of a war through one man’s eyes. Spielberg already had done similar stories set in World War II with “Schindler’s List,” the Holocaust saga that won him best-picture and director Oscars, and “Saving Private Ryan,” the combat epic that brought him his second directing trophy.

His approach began to coalesce in 1999, when he met with historian Doris Kearns Goodwin, who was in the early stages of writing her mammoth book, “Team of Rivals: The Political Genius of Abraham Lincoln,” a detailed chronicle of the unlikely alliances Lincoln formed with political opponents who initially considered him an unqualified upstart.

Her book traced the careers of Lincoln and his three competitors for the 1860 Republican presidential nomination and followed his White House years during the war through his assassination five years later. The notion of a politician turning bitter rivals into supporters and facilitators struck Spielberg as the ideal way to present the spirit of Lincoln.

Spielberg acquired film rights to Goodwin’s book when only a few chapters had been written. As Goodwin labored away on the writing, Spielberg had to condense what would become a 950-page account into a story that could play out on the screen in 2 ½ hours.

An early draft of the screenplay by playwright Tony Kushner (“Angels in America”) ran to 550 pages.

“It was a miniseries, not a motion picture,” Spielberg said. “Brilliant pages, but certainly not a single motion picture or any practical motion picture. But from all of those pages, what stood out to me and really was shockingly apparent was almost the nexus of his entire existence as the president, which was abolishing slavery by a constitutional amendment, the 13th Amendment.

“And that to me became the focus that I wanted to put all of our efforts into, telling that story. Because to see Lincoln at work, with his sleeves rolled up, with all the murky machinations of legislating a bill with a divided house not too dissimilar with what’s happening today, and not too dissimilar to what was happening when we first sat down to tackle Doris’ book. That to both Tony and me seemed to offer the sort of drama, and it was almost the very end of his life.”

So “Lincoln” takes its cue from the last couple of chapters in Goodwin’s book, playing out from January to April 1865, as Lincoln marshals his allies in the seemingly impossible task of passing the amendment while negotiating peace — without letting one jeopardize the other.

“Lincoln” co-stars Sally Field as the president’s forceful, high-strung wife, Mary Todd Lincoln; Joseph Gordon-Levitt as their oldest son, eager to enlist in the Union Army; David Strathairn as Secretary of State William Seward; and Tommy Lee Jones as firebrand abolitionist congressman Thaddeus Stevens.

Political veteran Seward had been the Republican front-runner in 1860, but the nomination went to dark horse Lincoln, a backwoods lawyer who had served just a single term in the U.S. House and lost two campaigns for U.S. Senate. Lincoln brought many opponents into his presidential fold, including Seward, whom he chose as secretary of state, “not unlike Barack Obama did with Hilary Clinton now as our secretary of state,” Spielberg said.

Goodwin’s study of the unlikely alliances Lincoln formed was critical to Day-Lewis’ approach to capturing the character of a leader who used his soft-spoken gifts as storyteller and raconteur to disarm critics and coax them toward his way of thinking.

“The central premise of that book is terribly important in the clue that it gives you to the temperament of that man, who could set aside what for all of us might be a sense of wounded pride or a sense of dignity that’s been bruised in some way,” Day-Lewis said. “He knew that he was regarded with almost complete contempt by most of those people that he appointed, and yet he could see beyond that, and it wasn’t with the rather petty-minded platitude of ‘keep your enemies close.’

“It was more to do with a generous understanding of what the value of those individuals was at a vital time.”

“Lincoln” opens Friday, just 10 days after the U.S. presidential election.

Spielberg knew he would be doing interviews leading up the election and that the story of Lincoln’s “house divided” would draw comparisons to the gridlock in federal government today.

“But we all made the conscious decision to come out after the election for no other reason than Lincoln has his place,” Spielberg said. “Lincoln is relevant to all of us today, but he had his place and he had his time, and we wanted Lincoln to have his place and his time outside or just after the election cycle.”