Though the election is hardly an exercise in democracy — the only candidate is Vice President Abed Rabbo Mansour Hadi — it represents an important transitional moment for an impoverished nation mired in a conflict that has left its troubled economy in tatters and many people dead or wounded.

“We want change. We want a new president,” said a shopkeeper, Yahya al-Qadhi, just after he voted. “It’s fine that only Abed Rabbo is on the ballot. If there was more than one candidate, then they would start killing each other and we are sick of the killing.”

Supporters of the president said they were voting because the transition was commissioned by Mr. Saleh, while the opposition relished the formal opportunity to force Mr. Saleh out of office. The election may be the only thing the two sides have agreed on after a year of bitter rivalry.

Turnout in the capital, Sana, appeared to be high, with long lines outside polling stations in schools and outsides mosques.

On the eve of the vote, Mr. Saleh bid farewell in a statement that signaled his hope to become what would be an anomaly of the Arab Spring: a toppled autocrat who can preserve some degree of influence in his nation’s governance.

“I say farewell to the authority,” Mr. Saleh said in the statement, which was read Monday by an anchor, Amal al-Sharamy, on Yemen state TV.

“I remain with you a citizen loyal to his homeland, his people and his nation as you have known me through thick and thin,” Ms. Sharamy read as she began to weep. “I will perform my duty and my role in serving the country and its just causes” via the ruling party.

The vote will serve as a mechanism to formally remove Mr. Saleh from power and strip him of his authority.

The prospect of an end to the violence and a chance at rebuilding delighted many Yemenis and provoked a noticeable change of mood on the streets of Sana.

“It’s finished,” said Obaid Ahmed, a thin taxi driver wearing a blue scarf wrapped around his head. “The war is over. There are no more checkpoints. Seventieth Street is open — the situation is improving,” he said, referring to a large street that passes in front of the Presidential Palace and has been closed since a fatal bomb attack on Mr. Saleh’s mosque in June. Its closure jammed traffic in Sana for months, making commuting across the city a test of patience.

But there was also a recognition by many that the transition of power was merely a first step for Yemen, the poorest nation in the Arab world and an American partner in combating terrorism. Al Qaeda and its followers have taken advantage of the power vacuum in Yemen to spread their influence and control, and one task ahead will be scaling back their advances.

A high-ranking Yemeni official who spoke on the condition of anonymity because of the sensitivity of the subject said the United States would be playing a leading role in the restructuring of the armed forces after Mr. Hadi officially became president. John O. Brennan, President Obama’s chief counterterrorism adviser, said there would be a series of visits from American officials who would focus on a variety of issues, including military restructuring.

“There needs to be a national army and national military that is going to fight against Al Qaeda,” Mr. Brennan said in a telephone interview. American assistance will go only to military and security units that are commanded by individuals who “are going to be professional and direct their forces appropriately,” he said. “We believe the Yemeni people are tired of having Yemeni military point their guns at one another.”

Speaking from Riyadh, Saudi Arabia, Mr. Brennan said the United States “applauds President Saleh’s most recent statement supporting the election and Vice President Hadi’s candidacy, and we encourage President Saleh to continue to play a constructive role as Yemen’s political transition moves forward.”

The United States government has had an extensive — and at times frustrating — relationship with Mr. Saleh over the past year while trying to ease him out of office. The autocrat, who has ruled this impoverished nation for more than 33 years, finally signed on to an internationally brokered agreement in November, transferring some of his presidential powers to Mr. Hadi and paving the way for Tuesday’s vote.

Having just finished a short trip here to the Yemeni capital, Mr. Brennan said he sensed “hope and optimism” from the nation’s leading officials in regard to the transition process.

Yet this hope, which many Yemenis are expressing for the first time in a long time, was also tempered by continuing violence.

In the southern port city Aden, there was an explosion on Monday at a voting center when gunmen open fired at a military unit, killing one soldier, Reuters reported. Voter turnout in the south, where a local secessionist movement is discouraging the population from taking part in the election, is expected to be very low. The same is expected in far northern Yemen, in Saada Province, which is controlled by a militant rebel group known as the Houthis.

The vote on Tuesday also did not guarantee an end to a violent clash between Mr. Saleh’s supporters and the opposition. Over the past year, a powerful military commander, Maj. Gen. Ali Mohsin al-Ahmar, split from the president and announced his support for a popular protest movement that swept through the country as similar popular uprisings spread across the Arab world.

The feud between Mr. Saleh and General Ahmar, which was waged on the streets of Sana and is not yet resolved, is a lingering issue “simmering beneath the surface,” Mr. Brennan said.

Although General Ahmar has promised publicly on several occasions that he would leave Yemen after Mr. Saleh agreed to step down, he has so far failed to keep his word. The general’s troops are still deployed in the northwestern section of the capital, although other government forces have been withdrawn over the past few months.

This article, “Yemen Votes to Formally Remove President,” originally appeared in The New York Times.