Tens of thousands of Egyptians have spent the night celebrating the election of the country's first freely elected president.
Mohammed Mursi, the leader of the main Islamic party the Muslim Brotherhood, got just over 50% of the vote.
It comes more than a year after people there started a revolution.
People celebrated after holding a vigil in Cairo's Tahrir Square for days in protest at a series of decrees by the ruling Supreme Council of the Armed Forces (Scaf).
They say they are designed to reduce or constrain the power of the president and push the power of the military.
Who are the Muslim brotherhood?
The Muslim Brotherhood, also known as al-Ikhwan al-Muslimum, is Egypt's largest and oldest Islamist organisation.
It was founded in the 1920s and aimed to spread Islamic morals but soon became involved in politics.
In 1948, the Egyptian government banned the Muslim Brotherhood and put some of its members in prison following several bombings and assassination attempts on former Prime Minister Mahmoud al-Nuqrashi.
During the 1980s, the Egyptian Brotherhood came back onto the political scene.
Some of its prisoners were released and the party was tolerated to various degrees.
In the 2005 elections, the party achieved its best election result to date, winning 20% of the total seats.
The result shocked President Hosni Mubarak and he launched a crackdown to prevent them from gaining more power and becoming a threat to the government.
The government's continuous resistance to the opposition was one of the main triggers for the mass anti-government protests by thousands of Egyptians in late January 2011.
As the protests grew and Mubarak fell from power, the party played a bigger part as Egypt's largest opposition force.
What do they believe?
While the party say that they support democratic principles, one of their aims is to create a country ruled by Sharia law.
Their famous slogan "Islam is the solution" has concerned critics, who think they may want to turn Egypt into a more extremist religious state.
In the past, the group has called for a council of religious scholars to approve all laws and said that Christians or women couldn't become president or prime minister.
The group has also been critical in the past of the long standing peace treaty with its neighbour, Israel.
Who is Mohammed Mursi?
Mr Mursi has been the Chairman of the Freedom and Justice Party since April 2011.
Mohammed Mursi has said he wants to create a more democratic and modern state and turn the economy around.
He's said that it is time to put into practice the Brotherhood's famous slogan but that it will have "a moderate Islamic reference".
No clear plan has been spelt out for how Mr Mursi will deal with the armed forces, who oversaw the political transition.