Three years after Egyptians rose up to demand the overthrow of Mubarak, thousands of demonstrators in Cairo's Tahrir Square chanted slogans backing another military man, General Abdel Fattah al-Sisi, as police clashed with Islamists and activists elsewhere.
The 29 people were killed in fighting across Egypt when police and supporters of the military-installed government clashed with Islamist backers of president Mohamed Morsi, who was deposed in July after a single turbulent year in power.
Egypt was already on edge after four bombs exploded in Cairo on Friday, including a massive blast outside police headquarters. The attacks, which were claimed by a Sinai-based extremist group, killed six people.
Hours before Saturday's rallies, a small bomb outside a police training centre in north Cairo wounded one person, while another 16 were wounded when a car bomb exploded beside a police base in the canal city of Suez, according to the health ministry.
Ansar Beit al-Maqdis, an Al-Qaeda-inspired group, claimed Friday's bombings, all of which targeted police, and urged Egyptian "Muslims" to stay away from police buildings.
Security forces across Cairo moved quickly to disperse scattered pro-Morsi protests while welcoming demonstrators to sanctioned commemorations.
In the Muhandiseen district, police fired tear gas and birdshot at anti-government protesters outside a mosque, scattering them into side streets.
Gunfire could be heard late into the night in the Alf Maskan neighbourhood, where some of Saturday's deadliest fighting took place, a witness said.
Of the 29 people killed, 26 died in Cairo and its suburbs, health ministry spokesman Ahmed Kamel told AFP. Another 168 people were wounded, and police said 725 suspected protesters were arrested.
One of the dead in Cairo was a member of the April 6 movement which spearheaded the uprising against Mubarak and had also opposed Morsi, a member of the group told AFP.
"The regime has substantial and now energised support, a majority of the politically active citizens of this country," said Michael Hanna, an expert on Egypt with The Century Foundation, a US-based think tank.
"But there are still resilient sources of opposition that they are choosing to deal with violently."
Police, who have killed hundreds of Islamist protesters in street clashes since Morsi's overthrow, have vowed to halt all such demonstrations.
But they encouraged Egyptians to turn out in support of the government, and some politicians called for rallies to back Sisi, the general who overthrew Morsi and whose popularity has skyrocketed among Egyptians craving stability after three years of turmoil.
The Islamist Anti-Coup Alliance which backs Morsi also urged its supporters in a statement to continue their "revolutionary movement" on Sunday in Cairo and other provinces.
Calls to kill Brotherhood members
Mubarak, who ruled for three decades, was forced to step down on February 11, 2011, after 18 days of demonstrations that left some 850 people dead.
The military took power until Morsi's election in June 2012, but then toppled him a year later after millions took to the streets demanding his resignation, accusing him of betraying the "revolution" that toppled Mubarak.
In Tahrir on Saturday, tanks guarded the entrances to the square as demonstrators waved Egyptian flags and carried posters of Sisi.
"The people demand the execution of the Brotherhood," demonstrators chanted, as several took their pictures with police officers, soldiers and tanks.
Celebrations continued well into the night in Tahrir and across several areas of Cairo, where groups of people waved flags, danced and played pro-military songs.
Government and military officials have hinted for days that the turnout at Saturday's pro-government rallies could be a bellwether for a run by Sisi in a presidential election promised for later this year.
Sisi is widely seen as a strongman who can restore order and fight militancy, which the interim government blames on Morsi's Muslim Brotherhood.
The Brotherhood, which renounced violence decades ago and won a series of elections following Mubarak's overthrow, condemned Friday's bomb blasts, as they have previous attacks on the police and army.
But after an attack on a police building in December, also claimed by Ansar Beit al-Maqdis, the authorities declared the Brotherhood a "terrorist organisation", making even expressions of verbal support punishable by heavy prison sentences.
Security forces have waged a bloody crackdown since Morsi's overthrow in which at least 1,000 people have been killed and thousands of Islamists have been arrested, including virtually all top leaders of the Brotherhood. Morsi has also been jailed.
Rights group Amnesty International said there has been "state violence on an unprecedented scale over the last seven months".