CAIRO (AP) — Gunmen armed with rocket-propelled grenades attacked a border guard post Saturday in Egypt’s western desert near Libya, killing at least 20 troops, security officials and a medic said.

An Interior Ministry official and a military official said the gunmen targeted a checkpoint in the western desert governorate of Wadi el-Gedid, on the Farafra Oasis Road, more than 500 kilometers (310 miles) from Cairo. Farafra is the country’s western most oasis, near the border with Libya.

The military official said about 20 gunmen in weapon-mounted vehicles took the checkpoint by surprise. Ensuing clashes killed three of the attackers, the officials and the state news agency MENA said.

Initially, officials said 15 troops were killed. But a senior military official in southern Egypt and a security official in the region said 20 were killed in an attack that destroyed the checkpoint. A medic with the local ambulance service said there were 21 bodies, some of them burned. Another medic said a local hospital treated five of the wounded.

The officials and the medic spoke on condition of anonymity because they were not authorized to speak to journalists.

MENA said this is the second time this border patrol company has come under attack from gunmen in the last few months. An earlier attack killed six troops, the agency said.

Egypt has long, porous borders with Sudan and Libya used by arms smugglers. Egypt has been flooded with weapons, mostly from Libya, following the 2011 civil war that toppled longtime dictator Moammar Gadhafi. Fighters from Libya also have come into Egypt from these borders, security officials say.

Egypt has vowed to tighten security along its borders.

This is the second brazen attack on troops in recent years during the holy month of Ramadan, when observant Muslims fast from dawn to sundown. In 2012, gunmen attacked a checkpoint near Egypt’s border with Gaza and Israel, killing 16 soldiers. It was one of the highest number of troops killed in recent years in one attack.

The attack Saturday came less than an hour before sundown.