Tonny Onyulo

Special for USA TODAY

MOGADISHU, Somalia — War-torn Somalia elected its first president in decades Wednesday evening, prompting street celebrations for the east African nation’s rare and successful exercise of democracy.

A former prime minister who has dual Somali-.U.S. citizenship, Mohamed Abdullahi Farmajo, won the presidency after two rounds of voting by members of parliament. He beat incumbent President Hassan Sheikh Mohamud, who conceded and avoided the need of a third round.

The voting by parliament was largely peaceful amid extraordinary security that included a lockdown in the capital city. The election was marred, however, by corruption that included allegations of vote-buying.

"History was made, we have taken this path to democracy, and now I want to congratulate Mohamed Abdullahi Farmajo," Mohamud told his supporters.

The concession speech sent the new president's supporters into the streets singing and dancing, some waving Somalia flags and blowing horns. Motorists stopped and joined the jubilant crowds.

“Our new president will change this country,” said Farah Ahmed, amid cheers from the huge groups waving banners and blowing vuvuzelas, a local horn-like instrument. “He is a person who can tackle security, corruption and improve the economy of our country.”

The election was conducted by members of parliament instead of voters because of threats of violence by the al-Shabab extremist group. Lawmakers held their vote in an aircraft hangar at a former air force base for added security.

Most businesses in Mogadishu, the nation's capital, were closed during the day Wednesday, and the streets were empty because of enhanced security after suspected militants fired mortar rounds Tuesday night close to the former air base.

Somalia lurches from chaos to first democratic rule in decades

The new president brings hope to the country, which has been disintegrating since 1991, when warlords ousted dictator Siad Barre, then plunged the nation into civil war. In the intervening years, militants took advantage of the political vacuum.

Nazlin Umar Rajput, a Somali political analyst based in Kenya and chairperson of the National Muslim Council of Kenya, said she believes the election can help Somalia turn the corner.

"It has invigorated hope in the hearts of the Somali people, Kenyans, the region, as well as the globe," she said. "I expect the president to forge a new path for his people and the region."

Ismael Gure, 46, chairman of an association of businesses in Mogadishu, noted that his country has not had a one-person, one-vote democratic election since 1969 and hoped the new president will restore peace and ensure citizens participate in the next election.

“It’s time our country start to thrive like other East Africa countries. Our country will no longer be divided along tribalism. We need the new president to restore security and improve the economy, Gure said.”

“He is going to be the president of entire country,” he added. “This round, the lawmakers did not choose the president because of their clans, instead they really represented the people’s will. He now has a very huge task to ensure that we all participate in a democratic election next elections."

Farmajo promised Somalis that he was going to fulfill the pledges he made during the campaign about improved security, education, democracy and the economy.

"This is a victory for Somalia and the Somalis," Farmajo told lawmakers just after he was sworn in.

Farmajo holds degrees from the State University of New York-Buffalo and was prime minister for eight months before leaving the post in 2011, according to the Associated Press. He had lived in the United States since 1985, when he was sent there with Somalia’s foreign affairs ministry, the AP reported.

Somalia, which has been working closely with the U.S. military to defeat al-Shabab, is one of the seven Muslim-majority countries listed in President Trump's travel ban last month barring its citizens from coming to the U.S.

At the same time, the United States, the United Nations and the European Union alleged "egregious cases of abuse" in Somalia's drawn-out election process and accused lawmakers of corruption, voter intimidation and violence.

Somalia’s auditor general, Nur Jimale Farah, had told Voice of America that two seats for parliament were bought for $1.3 million each. “Some votes were bought with $5,000, some with $10,000, and some with $20,000 or $30,000,” Farah said.

“This is probably the most expensive election, per vote, in history,” the Mogadishu-based anti-corruption group Marqaati said Tuesday in a report.

The celebrations went on anyway to welcome the new leader, not only here but also in the Daadab refugee camp in eastern Kenya and in Nairobi's Eastleigh estate, where thousands of Somalis took shelter after escaping violence and famine.

“We are happy because we have a new president now,” said Amina Adan, a Somali refugee who sells clothes in Eastleigh, a Nairobi neighborhood known as “Little Mogadishu.” “We need him to restore security so that we can go back to our country.”

Hassan Abdi, who lives in the Dadaab camp, said Wednesday’s election marks a new chapter for all refugees scattered across the globe.

“Our hope now begins today,” he said. “If Kenya's government closes the camp, we are sure of going back home because the new president vowed to fight insecurity and ensure all refugees return. I know he will.”