Cairo - Egypt's Mohamed Morsi pledged to be a leader for all Egyptians after becoming the first Islamist to be elected president of the Arab world's most populous nation following a divisive election.
Morsi, the country's first elected leader since a popular uprising ousted president Hosni Mubarak, won 51.73% of the vote against ex-premier Ahmed Shafiq.
"I will be a president for all Egyptians," Morsi said just hours after he was declared the winner.
"I call on you, great people of Egypt... to strengthen our national unity," he added. National unity "is the only way out of these difficult times".
Morsi, who resigned from the Muslim Brotherhood to take the top job, also thanked the "martyrs" of the uprising for the victory. "The revolution continues," he added.
The 60-year-old engineer also vowed to honour international treaties, adding: "We come in peace." Egypt was the first Arab country to sign a peace treaty with Israel, in 1979.
The election came after 18 months of a tumultuous military-led transition from Mubarak's rule, marked by political upheaval and bloodshed.
"The winner of the election for Egyptian president on 16-17 June is Mohamed Morsi Eissa al-Ayat," the head of the electoral commission, Faruq Sultan announced earlier on Sunday.
Hundreds of thousands of Morsi supporters erupted in celebration in Cairo's Tahrir Square, the symbolic heart of the uprising that brought down the Mubarak regime in February 2011.
Cheering Egyptians waved flags and posters of the Islamist leader, who was jailed during last year's uprising.
"God is greatest" and "down with military rule" they chanted, as fireworks went off over the square.
Across Cairo, cars sounded their horns and chants of "Morsi, Morsi" were heard.