CAIRO (AP) - The Muslim Brotherhood's Mohammed Morsi was declared the winner of Egypt's first free presidential election Sunday, and he proclaimed himself a leader "for all Egyptians," although he faces a struggle for power with the country's still-dominant military rulers.
The announcement by election officials touched off a joyous celebration of chanting and dancing in the sweltering heat by tens of thousands of Morsi's supporters jamming Tahrir Square, the birthplace of the uprising that toppled Hosni Mubarak 16 months ago.
It also capped a week of growing political tension in the streets after authorities delayed announcing the results of the runoff election between Morsi and Mubarak's former prime minister, Ahmed Shafiq.
Tanks and other signs of heavy security had been deployed around the country, especially outside state institutions, in anticipation of possible violence reminiscent of the first days of last year's revolution.
President Barack Obama telephoned the U.S.-educated Morsi to congratulate him on his victory and offer continued support for Egypt's transition to democracy. The White House said Morsi expressed appreciation for Obama's call and "welcomed U.S. support for Egypt's transition."
The reaction from Israel was subdued, with Prime Minister Benjamin Netanyahu saying he respected the results of Egypt's democratic process and hoped the peace agreement between the two countries would remain intact. Ecstatic residents in the Hamas-ruled Gaza Strip filled the streets, fired guns in the air and handed out candy.
Speaking on Egyptian television Sunday evening, Morsi declared he had a "message of peace. We will respect all international agreements." He did not mention Israel but the remark seemed to be a reassuring nod to respecting the peace treaty.
Morsi won 51.7 percent - a margin of only 800,000 votes - over Shafiq, a former air force colonel who was perceived to be the military's favorite, the election commission said. Turnout was 51 percent.
"I tell everybody in this memorable day, that because of your choice, your will, and after God's favor, I am a president for all Egyptians," the 60-year-old engineer, professor and former lawmaker said in his speech, delivered stiffly as he read from notes.
Monday's editions of Freedom and Justice, the Muslim Brotherhood's newspaper that bears the same name as the group's political party, bannered the headline: "The street explodes with joy, the people write history: Morsi President of Egypt."
It was a stunning victory for the Muslim Brotherhood, a group that was outlawed under Mubarak. But the liberal and secular youth groups that drove the uprising were left wondering whether Egypt has taken a step toward becoming a repressive Islamist state, or a new power sharing agreement between Morsi and the military - the traditional power brokers.
In his speech, Morsi sought to reach out to the activists by paying tribute to the nearly 900 protesters killed in the uprising. "I wouldn't have been here between your hands as the first elected president without ... the blood, the tears, and sacrifices of the martyrs," he said.
A week ago, when the polls were closing in the runoff election, the Supreme Council of the Armed Forces (SCAF) issued constitutional amendments that stripped the president's office of most of its major powers. The ruling generals made themselves the final arbiters over the most pressing issues still complicating the transition- such as writing the constitution, legislating, passing the state budget- and granted military police broad powers to detain civilians.
A few days before that, a court dissolved the freely elected parliament, which was dominated by the Muslim Brotherhood, leaving the military also in charge of legislating.
According to the constitutional declaration, the new president won't appoint the defense minister and will lose the title of "Supreme Commander of the Armed Forces."
Tens of thousands of Morsi's supporters vowed to stay in the square, pressing for the reversal of those actions by the generals. Mohammed el-Beltagy, a leading member of the Brotherhood and former lawmaker, said the protesters would not leave until the military fulfills its promises to hand over power to a civilian president by July 1.
Morsi also faces enormous challenges of improving the economy and maintaining law and order - both of which deteriorated in the post-Mubarak period.
Pro-democracy leader Mohammed ElBaradei urged unity after the results were announced.
"It is time we work all as Egyptians as part of a national consensus to build Egypt that is based on freedom and social justice," he wrote on his Twitter account.
Naguib Sawiris, a Coptic Christian business tycoon who joined a liberal bloc in voicing opposition to the Muslim Brotherhood on Saturday, said he expects Morsi to send a reassuring message to Egypt's Christian minority who represent around 10 percent of the population of 85 million.
"There are fears of imposing an Islamic state ... where Christians don't have same rights," Sawiris told the private TV station CBC. Morsi "is required to prove the opposite. ... We don't want speeches or promises, but in the coming period, it is about taking action. ... He was not our choice but we are accepting it is a democratic choice."
This is the first time modern Egypt will be headed by an Islamist and by a freely elected civilian. The last four presidents in the past six decades have all come from the ranks of the military.
"Before the revolution, we were forced to choose between Mubarak's ruling party and the Muslim Brotherhood (as the opposition). The revolution was about creating a third power, the people ... who are not seeking power but are seeking real change in the dynamics of power in Egypt," said Lobna Darwish, an activist who has boycotted the elections.
"I am happy the Brotherhood won because now the revolution will continue on the street against both of them, the Brotherhood and the SCAF," she said.
Khaled Abdel-Hamid, a leading leftist politician, said Morsi also needs to address the issue of meting out justice to former regime officials implicated in the killings of protesters in the uprising. Mubarak, 84 and in ill health, is serving a life sentence in prison for his role.