As the final act of the night, at a few minutes before 11, Barack Obama made his way to the podium in his cool and easy basketball-player gait, waving and smiling and washing in the glow of an adoring crowd that was shouting the chant that brought him into office: “Yes we can.”

Then he launched into a speech that demonstrated that he could — give one more memorable speech. It was, at once, a thorough defense of his administration, an ode to the idea that democracy is hard but works and that diversity is the essence of the American ideal, an attack on what he called the dark and pessimistic vision of Donald Trump and the Republicans, a gesture to the Bernie Sanders contingent by saying he felt the Bern, and a rousing endorsement of Hillary Clinton that reached his most preacherly cadences as he said he was “ready to pass the baton.”

It was part valedictory, part sermon, part campaign stem-winder, and in total it added up to the full Obama, a deeper and more experienced bookend to the speech he delivered in Boston 12 years ago that introduced him to the national scene. He at once presented the clearest statement of his political philosophy and attached it to the woman he wants to succeed him.

There were elements or echoes of almost every notable speech Obama had ever delivered somewhere in this convention address. He evoked his parents and grandparents again, as he had during that early keynote in Boston, adding the joking jibe at Trump and the birthers that he did not know whether his ancestors on his mother’s side who arrived in America 200 years ago had birth certificates. He drew on the speeches he delivered in Philadelphia and Selma and Charleston to evoke his feelings about race and justice and violence. He even fell back on the phrase that he took from his controversial preacher back during his Chicago days, the Rev. Jeremiah Wright, and said he still believed in “the audacity of hope.”

Twelve years. Four conventions. A political lifetime. It was at the Democratic convention only a dozen years ago that Obama rocketed onto the national political scene with that keynote address for John Kerry. Then, he was nothing more than a state legislator from Illinois who had polished the speech that would make him famous while hiding out in the men’s room at the rear of the Senate chambers at the state capitol in Springfield — scratching out phrases on a yellow pad, sneaking a smoke, taking advice on the phone, and rehearsing his delivery as he gazed into a bathroom mirror.

Watch President Obama’s full speech at the Democratic National Convention on July 27. (Video: The Washington Post; Photo: Michael Robinson Chavez/The Washington Post)

“I was so young that first time in Boston,” Obama said Wednesday night. “Maybe a little nervous addressing such a big crowd.”

From hello in Boston to goodbye in Philadelphia. From the fresh face with a peculiar name to the gray-haired veteran with perhaps the most famous name in the world. From the optimism of no-red-states-no-blue-states rhetoric to the hardened realism shaped by a long partisan struggle. From introducing himself as a symbol of American diversity to becoming a target of bogus birtherism propagated by, among others, this year’s Republican nominee for president.

Over the first 10 minutes, Obama presented the case for the progress his administration had made since he took office in January 2009. He portrayed a vision of an America that was “full of optimism and courage” and contrasted it with what he called the “darkly pessimistic vision” the Republicans presented in Cleveland last week. “We don’t look to be ruled,” Obama said. Then he turned the page, and made the case for Hillary Clinton, saying that no one who has come before, not himself or Bill Clinton, had ever been more qualified to be president.

In his full-throated endorsement of Clinton, who has become the embodiment of his legacy, Obama was in a sense returning a major favor, marking a new phase in the uneven relationship between the two first families of the Democratic Party. Four years ago it was Bill Clinton bailing out Obama, delivering a speech in Charlotte that explained the Obama presidency and framed the issues against the Republicans in a way that the president himself could not do. His voice hoarse, his message clear and aimed directly at the middle class, Bill Clinton dominated the stage and energized a convention crowd that had seemed frustrated and confused, searching for the winning case.

Now it was the turn of the Obamas. Michelle came to Hillary’s defense on Monday night with an impassioned speech that quieted an unruly crowd and changed the mood inside the arena, and two nights later here came the president.

His way was paved by Vice President Biden, his loyal right-hand man, who earlier in the night had called him “the embodiment of character and honor” and “one of the finest presidents we have ever had” — words that echoed through the arena at about the same time that Air Force One touched down at Philadelphia International Airport. Biden’s speech was so fiery and quintessentially Bidenesque in its regular-guy bluntness — with its riffs on “Not a Clue” Donald Trump and evocation of selfless teachers and the middle class and people who like him have endured profound personal loss — that it almost seemed to render Obama’s words, however eloquent, subordinate, if not redundant.

Before the traditional hagiographic video that introduced him, replete with his decision to go after Osama bin Laden and his powerful singing of “Amazing Grace” at the funeral of shooting victims in South Carolina, Obama was praised by a woman few had heard of before. Sharon Belkofer, a mother, grandmother and great-grandmother from Ohio who talked of losing her son in Afghanistan and of the two warm hugs the president gave her and how he had inspired her to run for local office at age 73.

Democratic presidential nominee Hillary Clinton joined President Barack Obama on stage at the DNC on July 27. (The Washington Post)

Nominating conventions are supposed to be about the future, not the past, even when the vision of the future revolves around such a familiar figure as Hillary Clinton. In that sense this is not Obama’s convention. He is not yet past, though on his way. But for many delegates here, it is the very realization that his time is almost up that imbued his appearance with an extra measure of wistfulness, a sensibility that was also evident in the delegate hotels all through the week.

Helen Norwood and Eddie Mae Henderson rode 12 hours on a packed bus from Chicago with an entourage of Illinois delegates and friends to be here to witness Obama’s farewell. They live on the South Side, in the neighborhoods of Hyde Park and North Kenwood, where the regular city bus they ride rolls right past Obama’s old house. Norwood is 92; Henderson the youngster at 83. Both said they have been surprised by history in their lives. Neither expected to live long enough to see a black president, and now that Obama is almost gone, their feelings about him have intensified.

“I’m proud of him as a president and as a black man who has attained that position,” Norwood said, resting in the lobby of the delegation hotel across from Philadelphia’s city hall on the eve of Obama’s speech. “I’m proud of him for what he’s done and how he did it. And I’m very proud of his wife. They are representative of what America stands for.

“Boy, we are going to miss him,” Henderson said. “He could talk to people on the street or world leaders. He was just down to earth.”

Even in the Illinois delegation, which along with Hawaii could claim Obama as a hometown kid, there were some people who said that although they would miss him they were ready to move on. One of those was James Clayborne, Democratic majority leader in the Illinois state Senate, who had served in that chamber back in the days when Obama was crafting his Boston speech in the men’s room. The characteristics that Obama later showed the world as president, his coolness under pressure and lack of drama, were apparent in Springfield, Clayborne said, and would be missed. “But it is time to look forward and not look backwards. Our best days are ahead.”

It was an open secret for much of 2016 that Obama — while staying neutral until it was almost over — leaned heavily toward Clinton in her match against Sanders, and that he saw her as the potential successor who could reaffirm and strengthen his presidential legacy. And though his relationship with both Bill and Hillary had been decidedly uneven, time and circumstances tempered most if not all the hard feelings going back to the bruising primary campaign of 2008.

The onetime foes became administration allies when Obama persuaded her to serve as his secretary of state, and they came to realize that they shared many common characteristics. While Bill Clinton was protean and natural, Hillary and Barack were more studious, cautious, set in their ways, preferring the rational over the emotional. All three of them were once law professors, but while Bill Clinton was prone to losing final exams on a plane and giving all his students A’s, because they might be voting for him some day, Hillary and Barack took the job more earnestly and were more likely to be hired as full professors if they had continued in their academic careers.

Obama’s role at the convention this week draws a direct line back to the first time he helped the Clintons, in 1992, before they even knew who he was. At age 31, as a young lawyer in Chicago fresh out of Harvard Law, he led a voter registration drive in the city that helped the Clintons carry Illinois at the beginning of their nearly quarter-of-a-century run.

Project Vote was sophisticated for its time, archaic by today’s standards, but was in a sense the beginning of the building of a coalition of women, blacks, Latinos and urbanites that dominates Democratic politics today, and that Obama is now turning over to Clinton.

The baton now passed, Obama offered one last phrase of gratitude. “Thank you,” he said, “for this incredible journey.”