WASHINGTON — The choreography was smooth, the smiles were gracious, but all the same, George W. Bush’s exit from Washington carried a measure of pain.

The now-former president fulfilled his role flawlessly. He extended his hand again and again to his successor: on the steps of the White House for morning coffee, as they entered the limousine to ride together to the inauguration, on the grandstand beneath the Capitol Dome.

And before he left the White House for the last time, Bush tucked into a drawer of the Oval Office desk a private note that aides said would convey his warmest wishes for Barack Obama.

But wafting around Bush throughout the day were sights and sounds that his presidency, which began with great controversy eight years ago, also had ended in controversy.

Just as demonstrators clogged the barricades to protest his court-mediated victory in the 2000 election, so the disenchanted lined Pennsylvania Avenue on Tuesday to express their dismay with the way that presidency turned out.

On the drive to Capitol Hill, the once and future presidents passed protesters carrying signs reading, “Arrest Bush.” When Bush made his entrance onto the grandstand with the orchestra playing “Hail to the Chief” for the final time, the crowd below began singing a different song: “Na-na-na-nah, Na-na-na-nah, Hey, Hey, — Goodbye.” One man waved his shoe.

Finally, when Bush’s helicopter lifted off from the Capitol, cheers rose from the crowd below and from the throng stretched down the Mall.

Perhaps nothing seemed to symbolize the wounded presidency as much as former Vice President Dick Cheney, who had to be transported through the inaugural ceremonies in a wheelchair, a cane clutched over his knees. Aides said he injured his back moving boxes into his new residence in Virginia.

Bush is famously thick-skinned. As the morning wore on, though, his smile appeared to grow more strained.

Perhaps one reason was the unmistakable enthusiasm for his successor, who drew far greater crowds than Bush did to either of his two inaugurations. Or perhaps it was that, despite Obama’s repeated thanks and handshakes, many of the words of the inauguration speech must have stung.

“On this day, we come to proclaim an end to the petty grievances and false promises, the recriminations and worn-out dogmas, that for far too long have strangled our politics,” Obama said.

“Our time of standing pat, of protecting narrow interests and putting off unpleasant decisions — that time has surely passed,” the freshly sworn-in president said.

Obama appeared to make an effort to be gracious, repeatedly thanking Bush for his help. After the swearing-in, Vice President Joseph Biden and his wife said farewell to the Cheneys, who departed in a motorcade. The Obamas then walked the Bushes to the helicopter. Obama gave Bush one final hug, the first ladies embraced, and the Bushes climbed the stairs. Now a private citizen, George W. Bush turned and gave one final wave. The Obamas waved back.

Bush’s inner circle and the Republican faithful express untarnished pride in his accomplishments and frustration that his presidency has been underappreciated. Several dozen White House staffers organized a private send-off for the Bushes in a closed hangar at Andrews Air Force Base, at which the former president and former first lady spoke movingly, sources said.

The Bushes then took off for his childhood home of Midland, Texas, from which he departed eight years ago.

In Midland, Bush told thousands of cheering well-wishers: “The presidency was a joyous experience, but as great as it was, nothing compares with Texas at sunset. Tonight I have the privilege of saying six words that I have been waiting to say for a while: It is good to be home.” Afterward, he and Laura flew to their Crawford ranch. The Bushes will divide their time between the ranch and their new home in Dallas.

Information from The Associated Press and The Dallas Morning News is included in this report.