Mohamud previously served as president from September 2012 to February 2017 and is now the country’s first leader to be twice elected head of state of Somalia.
After his election, he pledged to “work towards a stable policy that will bring Somalia to agreement and the world to agreement.”
Farmajo conceded defeat early Monday morning and congratulated Mohamud, urging support for the new administration.
Mohamud received a lot of positive feedback about his victory, including from the prime minister of neighboring Ethiopia, Abiy Ahmed.
Presidential elections have been delayed for more than a year due to a political crisis exacerbated by a power struggle between Farmaaho and ousted Prime Minister Mohamed Hussein Robl.
The incoming government will seek to contain the growing problems of Somalia bequeathed by the Farmaho administration. Somalia is facing its worst drought in decades and is battling a high cost of living and a resurgent Islamist al-Shabaab sect that continues to carry out deadly attacks throughout the country, including the capital Mogadishu.
Returning President Mohamud accused Farmaho of failing to rein in the deadly terrorist group since taking power in 2017.
Long recognized by the United States as a foreign terrorist organization, Al-Shabaab fought to overthrow the central government and establish a rule based on a strict interpretation of Islamic Sharia law.
Earlier in May, a violent sect took over a major African Union military base in Mogadishu, killing several Burundian peacekeepers.