Vice President Abed Rabu Mansour Hadi will be sworn in as president of Yemen on Saturday morning in front of Parliament after it was announced Friday that he had won the country’s single-candidate election with 99.6 percent of the vote.

The election, held across Yemen on Tuesday, was intended as an exit route for President Ali Abdullah Saleh, an autocrat who had agreed to step down after more than three decades in power and a year of antigovernment demonstrations calling for his removal. Mr. Saleh agreed to an internationally brokered accord last November that stipulated how the presidency would be transferred to Mr. Hadi. Tuesday’s elections were the culmination of that accord, which also granted Mr. Saleh immunity from prosecution for such things as turning his security forces on unarmed protesters calling for democracy before he agreed last year to relinquish power. Dozens were killed, and some in the military sided with the opposition.

While Mr. Hadi was the only candidate on the ballot, voter turnout was higher than all sides had anticipated.

A campaign over the past week to encourage Yemenis to vote — partly financed by foreign countries — included pro-election commercials starring famous local actors on Yemen television stations and billboards in Sana.

Mr. Saleh, who had been in the United States receiving medical treatment, “returned to his private residence in Sana, not the presidential palace,” early Saturday morning, said Mohammed Albasaha, a spokesman for the Yemen Embassy in Washington. He left the United States a few days ago for the Ethiopian capital, Addis Ababa, according to a Yemeni diplomat who spoke on condition of anonymity because he was not authorized to speak to press.

Yemen’s Supreme Commission for Elections and Referendum announced Friday evening that Mr. Hadi had won the election with 99.6 percent of the vote. A total of 6,651,166 Yemenis voted for Mr. Hadi and 15,974 voted against, by writing “No” in the box next to a photo of Mr. Hadi on the white ballot sheet, according to Nadia al-Sakkaf, the editor in chief of the English-language Yemen Times newspaper, who is helping to organize information about the election for Western news media.

Nearly 9,000 ballots were deemed invalid when, for example, some antigovernment protesters wrote statements like “the revolution continues” on their ballot sheets, apparently unwilling to vote for Mr. Hadi because he came from within Mr. Saleh’s inner circle.