Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Somalia's parliament has elected to the presidency a former prime minister with dual Somali-U.S. citizenship and — until very recently — a job at the New York Department of Transportation.

Mohamed Abdullahi Mohamed — widely known as Farmajo, after the Italian 'formaggio' for cheese — was elected Wednesday after receiving the votes of 184 lawmakers.

New Somali President Mohamed Abdullahi Farmajo sits in the election hall after being elected in Mogadishu, Somalia on Feb. 8. Farah Abdi Warsameh / AP

The 54-year-old's election was met with celebration on the streets of the one-time Italian colony, and celebratory gunfire rang for much of the night, Reuters reported.

Somalis in the United States celebrated too. Farmajo spent much of his adult life in Buffalo, New York, after fleeing the Somali civil war in the 1990s.

“We’re really behind our brethren and our [fellow] Buffalonian,” Ali Ahmed, a cashier at a local African market in Buffalo, New York, told NBC News. “So we support him 100 percent. It’s not only us, its every community in our area.”

Farmajo, who served as prime minister back in 2010, will likely need the support.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Though its situation has improved, Somalia, one of the world’s poorest nations, is still plagued by the Al Qaeda-aligned terror group Al Shabaab and decades-old clan divisions,

Related: Life on the Ground in the 7 Travel Ban Countries

Somalia is one of the seven nations singled out by the Trump administration's controversial plan to temporarily bar nationals from the U.S.

“He was very determined to go back there and do the right thing by his people, which he intended to do a few years back when he was prime minister,” Joel Giambra, a longtime friend and former colleague of Farmajo, told NBC News. “And it was clear that he did great work there, he seemed very popular with the people, but not with the corrupt politicians. He did the right thing and was forced to leave there.”

Mohamed's family in the U.S. declined to be interviewed.

The United Nations and others sounded alarms amid concerns of corruption and vote-buying in the months preceding the election after repeated delays to the presidential vote.

Civilians ride on a police car as they celebrate the election of President Mohamed Abdullahi Mohamed, Thursday. FEISAL OMAR / Reuters

However, those concerns were apparently assuaged, as the U.N., African Union, European Union, the Inter-Governmental Authority on Development and a host of nations, including the United States and the United Kingdom, issued a joint statement congratulating Farmajo and thanking his predecessor for the peaceful transfer of power.

“Yesterday’s orderly and peaceful transfer of power is a major achievement for Somalia and should boost confidence in the country’s future both at home and abroad. Hambalyo Somalia,” Michael Keating, the special representative of the U.N. Secretary-General for Somalia, said in the statement.

Longtime friend Giambra, who said he and Farmajo spoke about the latter’s policies many times, demurred on how the new president would proceed, saying only that his priorities lay in terrorism.

Related: Appeals Court Refuses to Reinstate Trump Travel Order

“He is committed to bringing peace and stability to his people and to his country. He has always said that [fighting] terrorism will be his number one objective,” Giambra said. “To eradicate terrorism in Somalia, as he said to me many times, the most effective way to stop terrorism in the United States is to stop it in Somalia.”

Matt Bryden, executive chairman of the Sahan think tank, told NBC News in December that the Somali National Army is often seen as an invading force because of old clan feuds, and that age-old tensions push communities to turn to Al Shabaab for help.

“The Somali government doesn't really control much territory … Somalia is basically starting from scratch,” said Bryden, a political analyst who has studied Somalia since 1996. “In the army, there are a handful of units that are integrated and effective, and they're mainly American trained. In 70 to 80 percent of the country, they're not welcome.”