Morsi, the candidate from the Muslim Brotherhood, faced off with former Prime Minister Ahmed Shafiq after the two candidates collected the most votes in the first round of Egypt's presidential election.
The days leading up to the runoff proved increasingly tense for Egypt, as judges appointed by former President Hosni Mubarak ordered parliament to dissolve, a blow to the democratically elected and Islamist-dominated governing body.
On the heels of the parliament ruling and in the midst of vote counting, Egypt's ruling military issued an interim constitution that seemingly deflated whatever power the next president would have.
Thousands took to the streets in protest as both presidential candidates declared victory early in the week, only to have their battle overshadowed by the announcement by Egyptian state media that Mubarak was "clinically dead." Those reports were later denied, with the official word of the 30-year ruler being on life support.
THIS IS A BREAKING NEWS STORY. READ THE FULL ASSOCIATED PRESS UPDATES BELOW.
CAIRO — Mohammed Morsi was declared Egypt's first Islamist president on Sunday after the freest elections in the country's history, narrowly defeating Hosni Mubarak's last Prime Minister Ahmed Shafiq in a race that raised political tensions in Egypt to a fever pitch.
The country's last four presidents over the past six decades have all came from the ranks of the military. This is the first time modern Egypt will be headed by an Islamist and by a freely elected civilian.
Throngs of Morsi supporters in Cairo's Tahrir Square erupted in cheers and dancing when the result was read out on live television. Some released doves with his pictures over the square where the uprising that ousted Mubarak last year was born. Others set off fireworks.
Morsi's spokesman Ahmed Abdel-Attie said words cannot describe the "joy" in this "historic moment."
"We got to this moment because of the blood of the martyrs of the revolution," he said. "Egypt will start a new phase in its history."
The announcement was the culmination of a tumultuous, 16-month transition that was supposed to bring democratic rule, but was tightly controlled and curtailed by the military rulers who took power from Mubarak.
The outcome will not put an end to the main power struggle in the country now between Morsi's Muslim Brotherhood and the military.
The election commission said Morsi won with 51.7 percent of the vote versus 48.3 for Shafiq. Turnout was 51 percent.
Farouk Sultan, the head of the commission, described the elections as "an important phase in the end of building our nascent democratic experience."