Despite the lack of choice, the turnout was heavy, said by the government to be 65 percent, suggesting that after more than a year of protests and unrest in which hundreds were killed, Yemenis were eager to embrace change.

“We consider this a historic day for Yemen,” said Ali al-Mamari, a legislator who quit Mr. Saleh’s party last spring after government supporters used violence against peaceful protesters. “All year there was a revolution, but now a new revolution started that is without weapons, without conflict, to transform our country into a civil state. I am incredibly happy.”

The challenges remaining, however, are immense.

“This transfer of presidential power is historic for Yemen,” said April Alley, a regional analyst for the International Crisis Group. “But it’s the days ahead that are going to really matter.

“There are the economic and security challenges that are immediate,” she said. “And also there are political challenges when it comes to pulling the country back together, dealing with the separatist movement in the south and a different set of grievances with the Houthis,” rebels who control Saada Province in the north.

The United States, which sees Yemen largely through the lens of counterterrorism, is expected to be involved in restructuring the military into what it hopes will be a more effective force against Al Qaeda. President Obama’s chief counterterrorism adviser, John O. Brennan, raised those concerns in private meetings with Mr. Hadi in Sana last week.

Even the accomplishment being celebrated on Saturday, the end of Mr. Saleh’s 33-year rule, was tempered by the reality that he still wields considerable influence. His relatives control most of the military and government security agencies, and it is not known how independent Mr. Hadi, a longtime Saleh loyalist, will be.

Mr. Saleh kept a low profile on Saturday and, despite having promised to hand over power formally to Mr. Hadi, did not attend the ceremony. He had been in the United States for medical treatment for injuries sustained in an attack on his presidential palace last June, and returned to Yemen early Saturday. He “returned to his private residence in Sana, not the presidential palace,” said Mohammed Albasha, a spokesman for the Yemeni Embassy in Washington, without elaborating.