Egypt declares a three-month-long state of emergency as it begins to bury the more than 30 security personnel killed in two attacks on Friday. (Reuters)

Egypt’s President Abdel Fattah al-Sissi said Saturday that an assault on an army checkpoint in the Sinai Peninsula that killed 30 troops was a “foreign-funded operation” and vowed to take drastic action against militants.

In remarks delivered before cameras ahead of a military funeral for the slain troops, Sissi said there are foreign powers that want to “break the back of Egypt,” without elaborating. He vowed to take extreme measures to uproot the militants and said Egypt is engaged in an “extensive war” that will last a long time.

“There is a big conspiracy against us,” he said while standing with army commanders.

Militants launched a complex assault on the checkpoint Friday that involved a car bomb possibly detonated by a suicide attacker, rocket-propelled grenades and roadside explosives placed to target rescuers.

Egypt declared a state of emergency and imposed a 5 p.m. to 7 a.m. curfew in the restive northern part of the peninsula after the assault, the deadliest against the army in decades.

Family members of security forces killed in Sinai on Friday react near an army vehicle as they wait for the bodies of their relatives at Almaza military airbase in Cairo Saturday. (Al Youm Al Saabi/Reuters)

No one has asserted responsibility for the attack, but it bore the hallmarks of the extremist group Ansar Bayt al-Maqdis, which has carried out several strikes on security forces since the military overthrew ­Mohamed Morsi last year amid massive protests against the ­Islamist president.

Sissi called on Egyptians “to be aware of what is being hatched against us” and to be “vigilant and steadfast with the army and the police.”

“All that is happening to us is known to us, and we expected it and talked about it before July 3,” he said, referring to the day last year when he overthrew Morsi. At the time Sissi was defense minister and army chief.

He claimed some success in the fight against militants, saying that “dozens of terrorists have been killed in the past weeks and months . . . hundreds of terrorists have been liquidated.”

Islamist militants have been battling security forces in Sinai for a decade, but the violence spiked after Morsi’s overthrow. The attacks have also spread to other parts of Egypt, with insurgents targeting police in Cairo and the Nile Delta.

The militants have portrayed the attacks as retaliation for a harsh crackdown by security forces in which hundreds of Morsi supporters have been killed in street clashes and some 20,000 people have been arrested.

The government has blamed much of the violence on the Muslim Brotherhood, the Islamist group that backed Morsi and which the government blacklisted as a terrorist group last year. The Brotherhood, which renounced violence decades ago, condemned Friday’s attacks and denied any involvement.

— Associated Press