(CNN) -- Unidentified gunmen attacked border guards in southern Egypt on Saturday, killing 21 and injuring four, according to Egypt's state-run news agency MENA.
The Egyptian army said a terrorist group fired a rocket-propelled grenade into an "ammunition store" at a checkpoint near Farfra.
In an exchange of gunfire, some militants were killed, the army said. Two cars with explosives were also confiscated.
"This incident will not discourage (guards) from carrying the national responsibility to protect and secure the country and hit the hotbeds of terrorism and extremism at all costs regardless of sacrifice," read an army statement.
The checkpoint is in Al-Wadi Al-Gedid province, which borders Libya and Sudan.
It was not clear whether the guards were on their way to the border or were already on the border when they were attacked, according to MENA.