The win was announced after three rounds of voting in which he beat his competitor 214 to 110 votes.
It was a repeat contest of 2017 when Mohamud conceded defeat to Farmaajo, a newcomer at the time.
Somalia's former president Hassan Sheikh Mohamud was on Sunday night re-elected into office following an intense contest with the incumbent Mohamed Abdullahi Farmaajo.
The win was announced after three rounds of voting in which he beat his competitor 214 to 110 votes.
It was a repeat of the February 8, 2017contest when Mohamud conceded defeat to Farmaajo, a newcomer at the time.
Mohamud and Farmaajo headed into the third round after beating two other candidates in the second round of voting. Only four contenders had proceeded to the second round of voting.
Second round results:
Hassan Sheikh Mohamud - 110
Mohamed Abdullahi Farmajo - 83
Saed Abdullahi Deni - 68
Hassan Ali Khaire - 63
In the third round, the winner required a simple majority to win.
On Sunday, Mohamud, profiting from a highly organised campaign and resource mobilisation, improved at every round of voting, garnering more votes from the bicameral federal parliament.
Some 327 legislators of the eligible 329 voted in the election, according to the Speaker of the House of the People (Lower House) Sheikh Aden Mohamed Nur Madobe.
“Candidate Mohamed Abdullahi Farmaajo garnered 110 votes while candidate Hassan Sheikh Mohamud attained 214 votes; 3 votes were spoilt,” announced Speaker Madobe.
Following the declaration of his win, Mohamud was immediately sworn in by the Chief Justice of the Supreme Court Bashe Yusuf Ahmed.
In a brief speech, Mohamud promised to reunite the nation and work with all stakeholders at all levels of the government.
“Let’s work together for the benefit of our people and country,” he told the audience.
Mohamud was Somalia’s president between 2012 and 2017.