Cairo (CNN) -- Hours after being declared his nation's first democratically elected president, Mohamed Morsi vowed late Sunday to represent all Egyptians, and he urged his countrymen to put aside their differences and come together for the common good.
"This national unity is the only way to get Egypt out of this difficult crisis," Morsi said in a nationally televised speech.
The longtime Muslim Brotherhood member paid special tribute to those "martyrs" who helped spearhead the revolution that led to the ouster of Egypt's longtime President Hosni Mubarak and, more than a year later, to Morsi's election.
He expressed thanks and admiration for military personnel, police officers, judges and others in the Egyptian government for their work on behalf of the nation. "I must salute them because they have a role in the future" of Egypt, Morsi said.
The president-elect also promised "we will preserve all national and international agreements," a topic of concern in light of questions about how his election might affect Egypt's ties with neighboring Israel. And he vowed to "protect the rights of women and children," as well as Christians and Muslims alike.
Earlier in the day, election officials announced Morsi earned more than 13 million votes in last week's presidential election, while Ahmed Shafik -- the last prime minister to serve under Mubarak -- had more than 12 million. That worked out to just under 52% of the vote for Morsi, while Shafik got just over 48%, officials said.
The announcement triggered massive cheers and celebratory gunfire in Cairo's Tahrir Square, the hub of last year's revolution, with temperatures near 100 degrees Fahrenheit (38 Celsius) failing to subdue the joy felt by Morsi's supporters. Similar rallies erupted Sunday in Alexandria as well.
"We've been waiting for it for 7,000 years," said Abdul Mawgoud Dardery, a member of the Muslim Brotherhood's Freedom and Justice Party. "For the first time in history, we have our own president, elected by us. The power of the people is now in the hands of the president -- and the president has to go and move forward."
Added another man celebrating in Tahrir Square, "What we are happy for is Egyptian people could overcome the remnants of the last regime."
Yet some Shafik supporters were crushed by the news. Manal Koshkani told CNN from a Cairo hotel that she and others "fear" the direction the Islamist party, the Muslim Brotherhood, could take Egypt.
"I hope we see a better future" Morsi, she said, adding, "I highly doubt it."
Egypt does not have a constitution, while military rulers dissolved parliament in the wake of a controversial and pivotal court ruling earlier this month. Moreover, the presidency as currently defined is largely a figurehead position as the Supreme Council of the Armed Forces (SCAF) maintains much of the control over the country, as it has since Mubarak's exit.
For this reason, a young Egyptian man named Mohamed Saleh dismissed the importance of the presidential vote. "(Morsi) doesn't have the power -- SCAF has the power," he said.
Yet Morsi, who resigned from the Muslim Brotherhood and its Freedom and Justice Party shortly after the results were announced in an apparent effort to send a message that he will represent all Egyptians, said late Sunday that he is "in charge" thanks to the vote, while stressing he must answer to the people.
"We are all equal in rights, and we all have obligations to carry on for this country," he said. "As for myself, I have no rights, but I have obligations."
Like Mubarak, Shafik is a former air force officer with close ties to Egypt's powerful military and was "the quintessential candidate of the counterrevolution," said Khaled Elgindy, a visiting fellow at the Brookings Institution in Washington.
Morsi, an American-educated engineer, "represents the older, more conservative wing of the Brotherhood and openly endorses a strict Islamic vision," said Isobel Coleman of the Council on Foreign Relations -- a view Morsi seemed to try to rebut in his speech Sunday.
Among others, his victory raised questions about how it might affect Egypt's relations with Israel. Morsi didn't directly address Israel on Sunday, though he did promise to maintain "agreements." He previously told CNN he'd honor Egypt's 1979 accord with Israel but in the past, the Islamist figure has referred to Israeli leaders as "vampires."
Israeli Prime Minister Benjamin Netanyahu, in a statement Sunday, said, "Israel appreciates the democratic process in Egypt and respects the results of the presidential elections. Israel looks forward to continuing cooperation with the Egyptian government on the basis of the peace treaty between the two countries, which is a joint interest of both peoples and contributes to regional stability."
Meanwhile a prominent Palestinian legislator, Hanan Ashrawi, said Palestinians "look for future corporation with Egypt and its supportive position for the Palestinian cause." She added that "the democratic process in Egypt should be propelled" by a movement to help it regain "its leadership in the Arab world and region."
Both campaigns had accused each other of fraud leading up to last weekend's runoff election.
And well before the official announcement, the two candidates both used social media to declare victory -- a claim they repeated, once again, early Sunday.
The results were expected to be announced earlier in the week, but were pushed back to Sunday. Even then, the head of the Supreme Presidential Election Commission kept people waiting -- after beginning 45 minutes later than expected, he took 45 minutes before finally announcing Morsi the victor.
Afterward, leaders from the country, region and world sent in their congratulations.
They included Egypt's Grand Mufti Ali Gomaa and the head of the Al Azhar religious authority Ahmed al-Tayeb, who both congratulated Morsi, according to state-run media. The two are key Muslim figures in the country who were appointed by Mubarak.
U.S. President Barack Obama called Morsi to congratulate him and pledge to "support Egypt's transition to democracy and stand by the Egyptian people as they fulfill the promise of the revolution."
Earlier, the White House issued a statement calling on Morsi "to take steps at this historic time to advance national unity by reaching out to all parties and constituencies," including respecting the rights of women and religious minorities such as Coptic Christians.
Others described Morsi's election as momentous but stressed that it doesn't mean the county's "revolution" or its problems are over.
Egypt's economy continues to struggle, with widespread poverty, high unemployment and its vaunted tourism sector still sagging on the heels of the political unrest.
With mass demonstrations and clashes with authorities common, the security situation remains tenuous.
Officials warned Sunday -- in advance of the declaration about the presidential winner -- that they were ready to carry out their longstanding policy of using deadly force against people who attack government buildings. More than 1,800 ambulances were dispatched across the county before the announcement in anticipation of election-related violence, the state-run EgyNews agency reported.
And even after Morsi's win, the political situation remains very much unsettled amid lingering questions about whether the military will loosen its grip on power.
Under an interim constitutional declaration, the military council said it retains the power to make laws and budget decisions until a new constitution is written and a new parliament is elected. The declaration said Supreme Council members "shall decide all matters related to military affairs, including the appointment of its leaders." Once sworn in as president, Morsi can declare war but only with "the approval" of the Supreme Council.
Wrote Wael Ghonim, the then-Google executive who helped organize the 2011 revolution, on Twitter: "The first elected civilian Egyptian president in the history of modern Egypt. The revolution continues."
CNN's Josh Levs, Saad Abedine, Ben Wedeman, and Dan Rivers and journalists Mohamed Fadel Fahmy and Ian Lee contributed to this report.