But the outcome leaves an already fractured country with bitter divisions and an uncertain future with the fallout from the bitterly disputed polls due to continue.
The opposition immediately refuted the result and warned of widespread protests, raising fears of further violence after troops shot six people dead and injured more than 30 in clashes with protesters on Wednesday.
Mr Mnangagwa passed the threshold for a first round victory of 50 per cent by 0.8 per cent while his main rival, Nelson Chamisa of the MDC (Movement for Democratic Change) alliance got 44.3 per cent.
The opposition leader, who had declared himself the winner before, during and after the voting refused to accept he had been defeated and accused the country’s election commission of being in collusion with the ruling Zanu-PF party.
The acrimony which has marked the campaign was present right at the end with the MDC chairman Morgan Komichi taking to the stage at the Zimbabwe Election Commission (ZEC) offices during the announcement of the result to claim that the figures being presented were false.
Mr Komichi was taken out by security guards after protests from Zanu-PF ministers and officials present but not before he had been able to denounce Mr Mnangagwa’s victory as fake in front of a swathe of international media present to record the results.
“The elections are fraudulent; everything has been done illegally," he declared.
Although Mr Mnangagwa’s Zanu-PF had won the parliamentary poll by a significant margin, his personal win was far less emphatic, falling below the 53 to 55 per cent predicted by his supporters as well foreign diplomats.
His supporters, however, acclaimed his “triumph” and 75-year-old Mr Mnangagwa, who had been acting president since Mr Mugabe’s overthrow last November, tweeted that he was “humbled” to be elected president. He added: “Although we are divided at the polls, we are united in our dreams. This is a new beginning, let us join hands in peace, unity & love to build a new Zimbabwe for all.”
But the confrontation between the government and MDC continued with police raiding the party’s headquarters on Thursday, arresting people and taking away computers.
The operation was part of a security crackdown following clashes between security forces and crowds protesting against the country’s election commission saying that the ruling Zanu-PF party had won the parliamentary poll by a large majority.
Mr Chamisa and other opposition leaders were being investigated, according to a warrant of suspected “possession of dangerous weapons” and encouraging “public violence”.
But the real reason for the raid, said Mr Chamisa, was to remove evidence the party has discovered of vote rigging by Mr Mnangagwa’s Zanu-PF. “But don’t worry, the evidence has already been taken to a safe house,” he said.
Just hours before the election result was announced Mr Chamisa had declared that he would not accept the country’s election commission awarding a “fraudulent” victory to rival Mr Mnangagwa, adding that “neither will the people”.
He dismissed the idea of making a legal challenge against the election result saying “that would be a slippery path". He said: "When you go into the court you are going into the lion’s den. We are not going to be a meal for the lions.”
A desperate Zanu-PF government, he claimed, was “using the tactics of Robert Mugabe” as was shown by the killing of protesters. “This government does not respect life,” he said and demanded that those responsible for ordering the shooting should be prosecuted, inferring this may include Mr Mnangagwa.
“The ranks of those responsible don’t come into it. How far does it go, does it include the commander-in-chief? Does it include the highest in the land? Who ordered the army to turn its guns on the people?” he asked.
“I have visited all those injured and bereaved families, they weren’t even MDC members, but people protesting against vote rigging. And those kinds of protests will continue if they think there is further vote rigging.”
Mr Mnangagwa has accused Mr Chamisa of whipping up violence with his rhetoric. As accusations and counter accusations continue there is sense of foreboding in Zimbabwe’s capital about what lies ahead.
The normally bustling streets of Harare have been extremely quiet for most of the day with many shops shut. The military are patrolling the streets and have been telling people to go home.
“I was told it was for my own safety, when I asked why they said there is likely to be violence,” said Fortune Nujei, an unemployed surveyor. “The only violence, I thought, had come from you guys. But I didn’t say anything, these are dangerous days I think.”
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies