Security forces and Islamist protesters clashed around the country Sunday, leaving 51 killed, as a national holiday celebrating the military turned to mayhem. Crowds from Egypt’s two rival camps — supporters of the ousted Islamist president, Mohammed Morsi, and backers of the military that deposed him — poured into the streets and turned on each other.

Several neighborhoods of the capital, Cairo, resembled combat zones after street battles that raged for hours. Morsi supporters fired birdshot and threw firebombs at police who responded with gunshots and tear gas. Streets were left strewn with debris, and the air was thick with tear gas and smoke from burning fires, as the crack of gunfire rang out.

A photographer saw nine bodies lying on the floor of a clinic in the Cairo district of Dokki, scene of some of the heaviest clashes. Most of the bodies had gunshot wounds to the head or chest.

Sunday’s death toll of 51 was the highest on a single day since Aug. 14 when security forces raided two sit-in protest camps by Morsi supporters, killing hundreds.

Even as fighting continued in the streets, the military went ahead with lavish celebrations for the holiday marking the 40th anniversary of the start of the 1973 Mideast war with Israel.

In the evening, a concert was aired live on state TV from a military-run Cairo stadium where pop stars from Egypt, Lebanon and the Gulf sang anthems to the army and dancers twirled on stage before a cheering crowd. Military chief Gen. Abdel-Fattah el-Sissi, other top brass and interim President Adly Mansour attended the show.

“There are those who think the military can be broken,” el-Sissi said in an address at the concert. “You see the Pyramids? The military is like the pyramids, because the Egyptian people are on its side.”

The clashes were the latest chapter in the turmoil roiling the country since the ouster in February 2011 of autocrat Hosni Mubarak.

Sunday’s holiday was an opportunity for Egypt’s leaders to further fan the pro-military fervor sweeping the country since the coup. But the holiday was also a chance for Morsi’s Muslim Brotherhood and its Islamist allies to show that they are surviving a fierce crackdown that has jailed more than 2,000 from their ranks since the coup.

Thousands of their backers held marches in various parts of Cairo, while at the same time crowds in support of the military took to the streets. In some cases, the two sides set upon each other, pelting each other with rocks and firebombs.

The Health Ministry reported 51 people killed nationwide, with at least 40 of them in Cairo, and more than 240 injured. The Interior Ministry, which is in charge of the police, said 423 Morsi supporters were detained across the nation.

The scene of Sunday’s fighting in Cairo contrasted sharply with a carnival-like mood in the city’s central Tahrir Square.

Soldiers barricaded entrances to central Tahrir Square with barbed wire and armored personnel vehicles to guard it against possible attempts by Morsi supporters to enter the plaza. Metal detectors were installed at the entrances and demonstrators pouring into the square were searched by troops. Army helicopters flew low over the square, with Egypt’s red, white and black flag trailing. Some two dozen F-16 jet-fighters staged a celebratory flight over Cairo in late morning, ushering in the commemoration of the 1973 war.