David Maraniss, an associate editor of The Post, is the author of “Barack Obama: The Story” and “First in His Class: A Biography of Bill Clinton.” This column is part of an occasional series on the 2012 presidential candidates’ political lives.

Barack Obama had other things on his mind and would rather not have been stuck in Springfield during those July days in 2004, but political realities left him little choice. The Illinois legislature was in session, and four years earlier the Chicago newspapers and his political opponents had scolded him for escaping to Hawaii and missing several days of a special session dealing with guns and urban crime. Lesson learned: He was now basically under orders to remain visible in the Senate chamber.

As the proceedings droned on, Obama kept a steady vigil at his back-row desk, four seats to the left of the center aisle, half-listening as he scrawled themes and phrases he might use in the most important speech of his career — the keynote address at the Democratic National Convention in Boston.

Every now and then, he would stroll over to the rear alcove, snatch a handful of almonds from the bowl on the desk of Barbara Mason, the woman in charge of Senate telephones, and take a call from an aide to the presumptive Democratic nominee, Sen. John Kerry of Massachusetts, who had plucked Obama from relative obscurity to deliver the convention’s first high-profile, prime-time speech. One afternoon, as the convention approached, a Senate colleague, Jeff Schoenberg, walked into the men’s room behind the back row and found Obama editing copy on a stool over near the mirrors, pen in his left hand, cellphone in his right, working out wording with his political adviser, David Axelrod.

The history of Barack Obama and Democratic conventions is short and uneven. He had attended his first one as a public official only four years earlier — an ignominious start. Already depressed after losing a Chicago congressional primary that year, he took a cheap Southwest Airlines flight to the 2000 convention in Los Angeles, where he discovered first that his credit card was bouncing and then that virtually no one knew him or cared that he was there. He fled back to Chicago long before Al Gore smooched Tipper and accepted the nomination.

It is a sharp reminder of how suddenly Obama rose that only eight years later he was accepting the nomination himself. But what lasts from that 2008 speech? His presidential campaign took flight with soaring rhetoric, yet he was unable to lift a single memorable phrase with him into the history books that night. Perhaps the only two things that remain etched in the public consciousness are that the first African American nominee gave his acceptance speech on a propitious date, the 40th anniversary of Martin Luther King’s immortal “I Have a Dream” speech, and that he was framed by some fake Greek columns inside the Denver Broncos’ football stadium.

But the 2004 speech Obama sketched out in the penalty box of the Illinois Senate chamber is the one that lasts, a presentation that made him an overnight sensation and set him on the path to the White House. Obama connected by finding the universal in the particular, presenting his own improbable rise — considering his name, his genealogical history and the color of his skin — as a symbol of American inclusivity and a common purpose that transcended red states and blue states, white and black, liberal and conservative.

On July 26, 2004, the night before his big moment, Obama called Marty Nesbitt, a pal from Chicago who had just arrived in Boston on a private jet with Penny Pritzker, one of the young politician’s wealthy supporters. Obama already sensed what was coming. “Hey, what’s going on? Do you want to hang out and see how my life has changed?” he asked Nesbitt. “Meet me in the lobby in the morning, and we’ll just kind of hang out together.” Nesbitt joined Obama on the circuit of breakfasts, lunches and rallies. “And he had this big speech, and he never mentioned it until we were walking down the street and this crowd started to build up behind him, and I said, ‘You’re like Tiger Woods, you know, at the Masters, a rock star,’ and he said, ‘You think it’s bad today, wait until tomorrow.’ And I said, ‘What do you mean?’ He said, ‘My speech is pretty good.’ ”

As Nesbitt listened the next night, he was anxious for the first 30 seconds, then sensed something clicking. Obama was at the top of his game, wowing the delegates in the hall and millions of viewers at home. The theme of that speech seems distant now, if not naive, considering how the political divisions and animosities have hardened during the course of his presidency. Yet that first impression, how he acted and what he said in Boston, still provides important clues to Obama’s present and future.

For all of his other characteristics — his unease about schmoozing, his writer’s sensibility as a participant observer, what some misinterpret as aloofness — the essence of Obama as a candidate is that of a confident jock, the guy Nesbitt hung with the day before his speech. He thrives on competition and does not shrink from it. Anyone who has played basketball with him, or poker, or even ping-pong or golf, will say the same things about his trash-talking, his boasting, his need to win. I’ve often said of Bill Clinton and Obama, two of my biographical subjects, that Clinton is hot and Obama is cool, but they burn at the same temperature inside. Just do it — that is the Obama of the campaign.

But if he wins a second term, the Obama I expect to emerge will more closely follow the lines of his 2004 speech. The right wing has made a cottage industry out of portraying him as a shape-shifter, trained by socialists, whose true leftist ideology will come out in a second term. His history points in the opposite direction. As a young man negotiating the shoals of race in America, as president of the Harvard Law Review, as a lecturer in constitutional law at the University of Chicago and as a state senator in Springfield, his instincts were to search for common ground. It has proved harder in the White House than anywhere he had been before, and there is no guarantee it would be any easier during a second term. But that is where he sees greatness, and that is what will drive him — those same thoughts he scrawled out during those summer days eight years ago when he was confined to the Senate chamber in Springfield.