In an announcement on state TV, Vice-President Omar Suleiman said Mr Hosi Mubarak had handed power to the military.
It came as thousands massed in Cairo and other Egyptian cities for an 18th day of protest to demand Mr Mubarak's resignation.
Protesters responded by cheering, waving flags, embracing and sounding car horns. "The people have brought down the regime," they chanted.
Mr Suleiman said Mr Mubarak had handed power to the high command of the armed forces.
"In the name of God the merciful, the compassionate, citizens, during these very difficult circumstances Egypt is going through, President Hosni Mubarak has decided to step down from the office of president of the republic and has charged the high council of the armed forces to administer the affairs of the country," he said.
"May God help everybody."
Mr Mubarak has already left Cairo and is in the Red Sea resort of Sharm el-Sheikh where he has a residence, officials say.
In Cairo, thousands of people are gathered outside the presidential palace, in Tahrir Square and at state TV.
They came out in anger following an address by Mr Mubarak on Thursday. He had been expected to announce his resignation but instead stopped short of stepping down, transferring most powers to Mr Suleiman.