The Muslim Brotherhood's Mohammed Mursi has called for national unity following his victory in Egypt's presidential elections.
Mr Mursi, an Islamist and Egypt's first democratically elected leader, said he would be president for all Egyptians.
He won 51.73% of the vote in last-week's run-off, beating former Prime Minister Ahmed Shafiq.
World leaders have congratulated Mr Mursi. The White House urged Egypt to be "a pillar of regional peace".
Days of tension led up to the declaration of the result after Egypt's ruling military council gave itself sweeping powers.
When the winner was announced, tens of thousands of Muslim Brotherhood supporters holding a vigil in Cairo's Tahrir Square erupted in jubilation.
"Down with military rule" they chanted amid wild cheering and explosions of fireworks.
Celebrations continued long into the night, with many of Mr Mursi's supporters still in Tahrir Square on Monday morning.
In a televised address, Mr Mursi paid tribute to the protesters killed in last year's uprising against former President Hosni Mubarak.
He said without the "blood of the martyrs" he would not have been elected.
"The revolution goes on, carries on until all the objectives of the revolution are achieved and together we will complete this march. The people have been patient long enough," he said.
"I call on you, great people of Egypt... to strengthen our national unity.
"Today I am a president for all Egyptians, wherever they may be."
Mr Mursi also praised the role of the country's powerful armed forces.
After the result, Mr Mursi resigned from his positions within the Muslim Brotherhood - including his role as chairman of its Freedom and Justice Party (FJP) - as he had pledged to do in the event of his victory.
Mr Mursi has promised that his leadership will be inclusive, and has courted secular and Christian voters.
Egypt's military ruler, Field Marshal Hussein Tantawi, was among the first to congratulate Mr Mursi.
UK Foreign Secretary William Hague also congratulated Mr Mursi, saying the election marked "an historic moment for Egypt".
The White House called the election "a milestone for Egypt's transition to democracy".
"We believe it is essential for the Egyptian government to continue to fulfil Egypt's role as a pillar of regional peace, security and stability," spokesman Jay Carney said.
Israeli Prime Minister Benjamin Netanyahu said he hoped the long-standing peace treaty between the two countries would continue.
Egypt was the first Arab state to sign a peace treaty with Israel but the brotherhood has traditionally been opposed to it.
Mr Mursi was also congratulated by losing candidate Ahmed Shafiq, a former general and minister under President Mubarak.
His supporters, who had been holding a rally in a Cairo suburb, were stunned by the result.
There was screaming and crying and people were seen holding their heads in despair.
The BBC's Kevin Connolly in Cairo says Mr Mursi's victory is a moment of profound change for Egypt.
The Muslim Brotherhood, that has seen many of its members put in prison, now has one of its leaders being sent instead to the presidential palace, he says.
Earlier, the head of the Higher Presidential Election Commission, Farouq Sultan, said Mr Mursi had won 13,230,131 votes (51.73%), compared with Mr Shafiq's total of 12,347,380, or 48.27%.
The turnout in last weekend voting was 51.58%, he added.
The Supreme Council of the Armed Forces (Scaf) has ruled Egypt since last year's revolution and has promised to oversee a transition to democracy.
However, a series of decrees has led many to believe it intends to cling on to power.
On 13 June, the justice ministry gave soldiers the right to arrest civilians for trial in military courts until the ratification of a new constitution.
The generals then issued a decree dissolving parliament in line with a Supreme Constitutional Court ruling that the law on elections to the lower house was invalid because party members had been allowed to contest seats reserved for independents.
Then, just as the polls were closing in the run-off, the Scaf issued a decree granted themselves legislative powers and reinforcing their role in the drafting of a permanent constitution. The military was also exempted from civilian oversight.
Last Monday, Field Marshal Tantawi announced the re-establishment of a National Defence Council, putting the generals in charge of Egypt's national security policy.
The generals have vowed to hand over power to the new president by 30 June, but their decision to dissolve parliament means Mr Mursi could take office without the oversight of a sitting legislature and without a permanent constitution to define his powers or duties.