Mohammed Mursi of the Muslim Brotherhood today won Egypt's hotly-contested presidential run-off beating former Prime Minister Ahmed Shafiq, as the Arab Spring that ousted strongman Hosni Mubarak finally bore fruit, giving the country its first non-military president.
Mursi, 60, was named the fifth president of Egypt after narrowly beating off competition from rival Shafiq, in the presidential polls held on June 16-17.
Announcing the results, the Supreme Presidential Electoral Commission (SPEC) head Farouq Sultan said Mursi, won 51.73 per cent of the vote, beating his rival Shafiq. Mursi won 13,230,131 votes against Shafiq who clinched 12,347,380.
Sultan said the election commission had upheld some of the 466 complaints by the candidates, but that the election result still stood.
Hours after he was declared winner, Mursi saluted the judiciary and the army for overseeing the democratic process.
"Respectful salutation to Egypt's honourable and just judiciary and to the brave men of the army and police who protected the democratic process with all honour. Congratulations to Egypt," he said on his website.
Both candidates had already declared victory in the hours before announcement leading to a tense stand-off between the two camps.
The announcement prompted scenes of jubilation in Cairo's iconic Tahrir Square, where thousand's of Mursi's supporters had gathered since yesterday.
"God is greatest" and "down with military rule", they chanted as some set off fire crackers minutes after the election commission formally declared the results.
Authorities in Egypt had been on "high alert" in advance of the announcement, concerned about what could happen if Shafiq won. Officials had said they were ready to carry out long-standing policy of using deadly force against people who attack government buildings.
Mursi's win in Egypt's first-ever genuine multi-candidate presidential elections puts an end to a 60-year military monopoly of the position.
His predecessors Mohamed Naguib, Gamal Abdel-Nasser, Anwar El-Sadat and Hosni Mubarak, who ruled the country since the 1952 Free Officers' Coup, all came from the army's ranks.
Egypt's military ruler Field Marshal Hussein Tantawi today congratulated Mursi on his presidential victory.
"Field Marshal Hussein Tantawi congratulates Dr Mohamed Morsi on winning the presidency of the republic," state media reported.
The military and the Brotherhood have been in a public conflict in recent days. The ruling Supreme Council of the Armed Forces (SCAF) has criticised the Mursi campaign for announcing his victory too early, while the Brotherhood have warned against fraud.
A series of controversial decrees by the ruling SCAF have angered the Islamists who say they are designed to reduce or constrain the power of the president, and entrench the power of the military.
Earlier, Tantawi had announced the re-establishment of a National Defence Council, putting the generals in charge of Egypt's national security policy.
Reports have also circulated that the Brotherhood was in negotiations with the SCAF over the presidency.
The inauguration of Mursi, nonetheless, does not imply that the military institution will loosen its grip on power. Recent developments give the military junta extra authorities at the expense of the president's.
Mursi was the first to claim victory last Monday after voting wrapped up.
Mursi's rival Shafiq, a former air force commander and the last prime minister under deposed President Hosni Mubarak, had also claimed victory after the run-off.
SPEC said that they were examining more than 400 appeals of irregularities during the voting which caused delay in the announcement of the results.
Egypt's 2012 presidential elections were the second in the country's history.
The first Egyptian presidential polls took place in 2005 and saw then president Mubarak secure a clear victory, which many observers chalked up to massive vote-rigging by the now defunct National Democratic Party (NDP).
Mubarak, 84, remained in power for 30 years until the military forced his resignation after 18 days of countrywide protests.
Men held their heads between their hands in despair and many women cried as Egypt brimmed with emotions at the historic announcement.
Sultan, first began the news conference for announcing Mursi's victory by saying the declaration of the result had been "marred by tension and a bad atmosphere".
"The commission applied the law when it looked into the ballots. There is nothing above the law," he asserted.
Sultan also dismissed what he said had been the two most serious complaints of electoral violations, that some ballots had been printed with the name of one candidate already ticked, and that Christians had been prevented from voting in a village in Minya governorate.
He then spent several minutes announcing minor amendments to the vote tallies before announcing Mursi as the winner.
The turnout in last weekend voting was 51.58 per cent, Sultan added.
Electoral tension loomed large in Egypt in recent days along with the question of how much power the new president will actually wield now that the military council has full legislative authority.
Under an interim constitutional declaration, the military council retains the power to make laws and budget decisions until a new constitution is written and a new parliament elected.