(Details added - first version posted at 00:58)
Gunmen killed 21 Egyptian military border guards near the frontier with Libya on Saturday, highlighting a growing threat from an area that security officials say has become a haven for militants seeking to topple the Cairo government, Reuters reported.
Security officials said the assailants were smugglers. But an army spokesman said on his Facebook page that "terrorists" - the term authorities use to describe Islamist militants - were behind the attack.
He said a weapons storage facility was blown up by a rocket-propelled grenade in an exchange of fire, killing the soldiers and wounding four others.
The attack took place in Wadi al-Gadid governorate, which borders both Sudan and Libya. Two smugglers were killed in clashes with the guards, security officials said.
Egyptian President Abdel Fattah al-Sisi has repeatedly expressed concerns about militants who have capitalised on the chaos in Libya and set up operations along the border.
Sisi met with top Egyptian security officials after the attack, state news agency MENA reported.
Security officials say militants pay smugglers to transport weapons, including machine guns and rocket-propelled grenades, to comrades in Egypt, which is already facing an Islamist insurgency based in the Sinai Peninsula near Israel.
Sinai militants have stepped up attacks against policemen and soldiers since then-army chief Sisi toppled President Mohamed Mursi of the Muslim Brotherhood last summer and launched a fierce attacks on Islamists.
Hundreds have been killed in shootings and bombings.
Security officials say militants operating from Libya are trying to forge ties with Islamists in the Sinai, an alliance that could prolong Egypt's instability and scare away investors that are badly needed to help fix the battered economy.
Tribal smugglers told Reuters they charge up to one million Egyptian pounds ($140,000) to move weapons in four-by-four vehicles along desert routes.
Five border guards were killed in a similar attack in the same area a few months ago.
Security officials say militants along the Libyan border harbor ambitions similar to the al Qaeda breakaway group that has seized large swathes of Iraq - they want to topple Sisi and create a caliphate in Egypt.
Sisi, who has warned that Islamist militants ravaging the Middle East pose a threat to everyone, has said Egypt will not allow Libya's turmoil to threaten Egypt's national security.
Egypt considered launching a cross-border offensive several months ago in a bid to crush the militants, according to two Egyptian national security officials.
Follow us on Twitter @TRENDNewsAgency