On the third anniversary of the uprising that promised to free Egypt from autocratic rule, thousands of demonstrators rallied in the capital Saturday to show support for the military figure who overthrew the country’s first democratically elected president.

Rival groups of demonstrators across the country were met with deadly force. Clashes between police and anti-coup protesters aligned with Mohamed Morsi — and in a few cases, with liberal anti-military protesters — left 29 dead and nearly 170 injured, according to the Health Ministry, a day after six people were killed in a string of attacks on security targets in Cairo. Twenty-six of the deaths were in greater Cairo, the ministry said.

Morsi’s supporters in the Anti-Coup Alliance, an Islamist coalition, said at nightfall that 40 people had been killed nationwide. The Health Ministry releases only the tally of bodies received by government hospital morgues, while activist tolls are often drawn from field hospitals and family members.

Earlier in the day, supporters of Egypt’s military commander, Gen. Abdel Fatah al-Sissi, gathered in a tightly secured Tahrir Square, the epicenter of the pro-democracy revolt that overthrew strongman Hosni Mubarak in 2011, to chant pro-military and nationalist slogans and urge Sissi, the man who led the July coup that ousted Morsi, to run for president. The scene contrasted sharply with the pluralistic atmosphere of the 2011 uprising, in which liberal youth activists, Islamists and others joined hands to call for Mubarak’s ouster and democratic reforms.

Gone were the tents and banners of the multitude of political parties and activist groups that have taken to the square over the past three years to talk about, compete for and voice their demands for Egypt’s political transition.

“There is no space for us,” said Marwan Yassin, a 23-year-old liberal activist from the coastal city of Alexandria. Yassin participated in the rallies that led to Mubarak’s downfall, but he said that “the youth have no faith in the political process now.”

Nearly every banner in Tahrir Square on Saturday bore Sissi’s face. Even the relatively few posters with the names of political parties, such as the liberal al-Wafd, were paired with the general’s face. Patriotic tunes blared from a stage, and military helicopters circled above. State television aired footage of pro-military Egyptians dancing in cities across the country.

“It’s not their right” to be here, Hani Mahfouz, a movie theater manager, said of Morsi’s backers in the Muslim Brotherhood and the liberal and leftist groups that spearheaded the 2011 protests but were visibly absent from Tahrir Square on Saturday. “They are the political front for terrorism,” he said of the activists, many of whom have been jailed under the new military-backed government after protesting restricted freedoms.

“This ‘military rule’ [phrase] that they use is offensive,” he added, referring to activist chants. “Our military is the best in the world.”

The few sizable anti-coup demonstrations that materialized across the capital Saturday were met almost instantly with force. Police fired live ammunition at anti-government demonstrators on the outskirts of Tahrir Square and in other areas of the city.

In the capital’s Dokki neighborhood, police in black ski masks and bulletproof vests fired volleys of tear gas and bullets into an anti-coup march, as spectators cheered them on. Swarms of young men appeared to be assisting the police, dragging other young men — apparently from the other side — back to police lines.

“I didn’t do anything,” screamed one young man as he was dragged away by others in civilian clothes. Bystanders there and in other parts of the capital said there had been exchanges of gunfire between police and Brotherhood protesters.

An Interior Ministry official said at least 350 people were arrested nationwide.

Also Saturday, militants launched three attacks on government security targets, including a car bombing aimed at a central security force barracks in the city of Suez, in Egypt’s vital canal zone.

The militant group Ansar Bayt al-Maqdis claimed responsibility for the downing of a military helicopter in the Sinai Peninsula on Saturday afternoon. The statement released to jihadist forums said the group’s fighters fired a surface-to-air missile at the helicopter, in what would be the first known deployment of the shoulder-fired weapons by extremists waging an insurgency against security forces in the Sinai desert.

Local media also reported that a surface-to-air missile was used to bring down the aircraft, quoting security officials.

The fresh violence came a day after Ansar Bayt al-Maqdis claimed responsibility for Friday’s bomb attacks in the heart of Cairo, including a powerful explosion at the city’s police headquarters.

Sharaf al-Hourani contributed to this report.