Mohamed Morsi, the Egyptian president-elect, took a symbolic oath of office during a rousing speech in Cairo, promising dignity and social justice to a crowd of tens of thousands gathered in Tahrir Square.
He swore to uphold the constitution and "the republican system", reciting the words of an oath which he will formally take on Saturday morning in front of the supreme constitutional court. "I will look after the interests of the people and protect the independence of the nation and the safety of its territory," he said.
Morsi opened his speech by addressing himself to "the Muslims and Christians of Egypt," and promised to preserve a civil state.
"We will complete the journey in a civil state, a nationalist state, a constitutional state, a modern state," he told the crowd, to applause and cheers.
Morsi, a former Muslim Brotherhood official, promised to end torture and discrimination, and to deliver social justice for millions of Egyptians.
He also issued several challenges to the Supreme Council of the Armed Forces (SCAF), Egypt's military rulers.
He insisted that "no institution will be above the people," critiquing an army which has sought to shield itself from parliamentary oversight. "You are the source of authority," he told the crowd.
Morsi also vowed to work for the release of civilians arrested by the army since the revolution; more than 12,000 people have been tried by military tribunals since February 2011, according to local human rights groups.
'I don't fear anyone but God'
The symbolic oath was a way for Morsi to defuse a lingering political problem. The president traditionally takes the oath of office before parliament, but the legislature was dissolved earlier this month by a high court ruling.
In response, the ruling SCAF shifted the venue to the court, but Morsi was reluctant to take the oath there, for fear of appearing to support the court's ruling.
Tens of thousands of people packed into Tahrir for the speech [EPA]
The Muslim Brotherhood's Freedom and Justice Party had the largest share of seats in parliament, and has vowed to fight its dissolution.
Much of his speech took a populist tone. He spoke for several minutes from behind a lectern, then stepped away to address the crowd more directly.
At one point, he lifted up his suit jacket to show he was not wearing body armour. "I don't fear my people," he said. "I don't fear anyone but God."
He also spoke briefly about Egypt's foreign relations, promising to improve relations with neighbours in Africa and the Middle East, and to "keep the peace".
"We will never give up the rights of Egyptians abroad," he said. "Respecting the will of the people is the basis of our foreign relations."
The president-elect tried to reassure several groups worried about what a Muslim Brotherhood presidency means for Egypt. He made several mentions of "artists and intellectuals", promising to make Egypt a cultural and artistic leader.
On the other hand, in a remark sure to worry Western leaders, Morsi also promised to work to free Omar Abdel Rahman, the Egyptian cleric currently serving a life sentence in the United States for planning the 1993 attack on the World Trade Center. His pledge was most likely a sop to the Salafi groups which have made Abdel Rahman's release a prominent issue.
Not the end of military rule
Morsi will formally take his oath on Saturday morning, and then travel to Cairo University to deliver an inauguration speech.
He will take office amidst a great deal of political uncertainty. He swore to uphold the constitution, but Egypt still does not have a permanent constitution, only a series of "constitutional declarations" issued by the ruling generals.
Shortly before parliament was dissolved, lawmakers appointed a 100-member assembly to draft a new constitution. That panel, too, may be dissolved by court order, though the administrative court hearing the case says it will not issue a ruling until July.
The generals are keen to portray Saturday's swearing-in ceremony as a formal handover of control to a civilian government. But SCAF will continue to wield a great deal of power, perhaps more than Morsi: The military council will control legislative authority, and the Egyptian budget, until a new parliament is elected later this year.
It is also unclear how much power Morsi will have over the military or Egypt's sprawling security services, which spent decades oppressing the Muslim Brotherhood.