EL-ARISH, Egypt -- Egyptian President Abdel Fattah el-Sissi blamed the Muslim Brotherhood for playing a role in a sophisticated insurgent attack that killed 31 people in Egypt's volatile northern Sinai Peninsula. El-Sissi, a former army chief, cut short a trip to Ethiopia to return to Cairo Friday, as state television broadcast the arrival of the bodies of slain soldiers in coffins draped with Egyptian flags.

It is the second major deadly attack on Egyptian security forces in Sinai in the last 6 months; 31 soldiers were killed in another operation in October 2014. The continued success of the Sinai-based Islamic militants, despite more than a year of being targeted by massive military operations, highlights the resilience of the militants and represents an embarrassing security failure for el-Sissi and his administration's high-profile war on terror.

An Islamic State group affiliate in Egypt has claimed responsibility for the attack. The group, previously known as Ansar Beit al-Maqdis, has launched a steady stream of attacks against police and the army in Sinai in recent years. It was initially inspired by al-Qaida, but last year it pledged allegiance to the Islamic State group -- which controls about a third of Iraq and Syria -- and renamed itself the group's Sinai Province.

However El-Sissi immediately laid the blame on the Muslim Brotherhood, the Islamist movement that has been banned from Egypt and declared a terrorist group. El-Sissi, then defence minister, ousted longtime Muslim Brotherhood official Mohammed Morsi from the presidency in July 2013 after massive nationwide protests against Morsi's rule.

The popular coup against Morsi produced an immediate spike in violence in Sinai, where Islamic militias declared war on the Egyptian government and all Egyptian security personnel. Brotherhood officials insist they have no direct connection to the Sinai militants. But el-Sissi directly blamed the group for co-ordinating the ongoing Sinai violence.

"What is happening now is the price Egypt is paying for rejecting this organization," el-Sissi said before leaving Ethiopia. "Egypt is waging a war against the strongest clandestine group over the past two decades...This organization has secretive arms, secretive thoughts and secretive forums."

El-Sissi has already presided over a massive crackdown on the Brotherhood, imprisoning thousands and killing hundreds in street protests. His government has declared a state of emergency in northern Sinai, imposed a curfew and ordered the demolishing of hundreds of houses in order to clear a buffer zone along the border with the Gaza Strip and choke the flow of weapons through underground tunnels.

Meanwhile details emerged about the multi-pronged insurgent attack, which targeted multiple sites inside a heavily fortified military zone in the northeastern region of the peninsula. According to Egyptian authorities, the attacks started while soldiers were watching a soccer match Thursday night inside the Battalion 101 base in the city of el-Arish, the provincial capital of North Sinai province.

One suicide bomber disguised as a tanker-truck driver delivering water to the base, blew up his vehicle after soldiers allowed him onto the grounds, a senior army official said. Two other suicide bombers in pickup trucks then blew up their vehicles at the rear gate of the base and at an adjacent security headquarters, demolishing the gates and wall.

At the same time, insurgents in multiple locations launched mortar attacks, targeting police and army checkpoints, a police social club and a hotel for the armed forces. The total death toll reached 31, including two civilians. At least 60 people were wounded, some critically, health officials said. All officials spoke on condition of anonymity because they were not authorized to speak to the media.

Kamal Habib, a former Islamic militant and now a researcher on Islamic movements, said that the attacks challenge el-Sissi's administration to make a "drastic shift in its strategy in tackling the roots of militancy."

He said that increasing sophistication of attacks show a "significant transformation" by the Sinai militant groups.

"They are the ones in control on the ground, moving freely during curfew hours, and storming banned military areas," Habib said. "They are telling everyone we are here, in control."

In Washington, State Department spokeswoman Jen Psaki condemned the attacks, adding that the "United States remains steadfast in its support of the Egyptian government's efforts to combat the threat of terrorism in Egypt."

Sinai-based militants have exploited long-held grievances in the impoverished north of the peninsula, where the mainly Bedouin population has complained of neglect by Cairo authorities and where few have benefited from the famed tourist resorts in the more peaceful southern part of Sinai.

The police in northern Sinai largely fled during the 2011 uprising that toppled longtime autocrat Hosni Mubarak, as militants attacked their stations and killed scores of security forces.

In a posting on its Twitter account, the Sinai Province called the attack "an extensive, simultaneous offensive for the soldiers of the caliphate."

In its first statement after the attacks, the General Command of the Armed Forces vowed to continue to "uproot terrorism" and intensify its crackdown on militants across the country.