Mohammed Mursi has been sworn in as Egypt's first civilian elected president at an historic ceremony in Cairo.
Afterwards, he was saluted by Field Marshal Hussein Tantawi, leader of the Supreme Council of the Armed Forces which is handing over power.
Mr Mursi has promised to restore the parliament which was dissolved by the military council, which assumed legislative powers the day before the election under an "interim constitutional declaration".
In a speech at Cairo University on Saturday, Mr Mursi said the army must respect the people's will.
"The army is now returning to its original role, protecting the nation and its borders," he said.
The Supreme Council later handed over power to Mr Mursi after a military parade at the Hykestep military base on the outskirts of Cairo.
"We have fulfilled our promise which we made before God and the people," Field Marshal Tantawi said at the ceremony.
"We now have an elected president, who assumed Egypt's rule through a free and direct vote reflecting the will of Egyptians."
Mr Mursi was sworn in at the Supreme Constitutional Court. On Friday, he performed prayers at the al-Azhar mosque in Cairo, one of the most prominent seats of learning in Sunni Islam.