Egypt's presidency has announced three days of national mourning after gunmen killed 21 military border guards Saturday near the border with Libya in one of the largest assaults targeting security forces in years.
The attack in a desert area in Wadi Al-Gadid governorate, 630 kilometres west of Cairo, also left four soldiers wounded, the military said in a statement
It added that the attack was carried out by "terrorists" who fired a rocket propelled grenade, in an exchange of fire, that blew up a weapons depot at a post in the local town of Farafra, killing the soldiers.
Militants have stepped up attacks on policemen and troops since the army's ouster of Islamist president Mohamed Morsi in July 2013 and an ensuing deadly crackdown on his supporters.
The army has since struggled to crush an Islamist insurgency, mainly based in the border Sinai Peninsula, that has killed hundreds in bombings and shootings.
Egyptian President Abdel-Fattah El-Sisi convened late Saturday an emergency meeting with the country's National Defence Council to discuss "internal and foreign threats to Egyptian national security" and address "counterterrorism efforts," read a statement in which the council vowed to avenge the killings.
The army said the assault occurred mid-afternoon during fasting in the Islamic month of Ramadan. It was condemned by the country's religious and political figures as "vile" and "treacherous."
Three of the assailants were also killed in the attack near the frontier with Libya, rocked by deadly unrest since the 2011 NATO-backed uprising that toppled autocrat Muammar Gaddafi, state news agency MENA reported.
Five border guards were killed in a similar assault in the same area over a month ago.
Saturday's assault comes almost a week after seven civilians and a soldier were killed in rocket attacks in the volatile Sinai Peninsula, adjoining Israel and the Palestinian Gaza Strip.