CAIRO (AP) — Just days after the worst terrorist attack in Egypt's modern history, President Abdel-Fattah el-Sissi on Wednesday gave his security forces a three-month deadline to restore "security and stability" in the troubled northern Sinai, the epicenter of an increasingly brutal Islamic insurgency.

In a televised ceremony marking the birthday of Islam's Prophet Muhammad, el-Sissi authorized his new chief of staff, Maj. Gen. Mohammed Farid Hegazy, to use "all brute force" against the militants.

The speech was a very public show by the Egyptian leader that he will take new action after last Friday's startlingly grisly and bloody attack on worshippers in a mosque In a Sinai village. But it also represented a risk for el-Sissi. In his speech, he gave no indication what would happen if the military fails to defeat within three months militants who have been battling his security forces for more than three years.

El-Sissi's calls for "brute force," repeated several times since the attack, appear to signal a new escalation, suggesting the military could turn to scorched earth tactics that many of the president's loyalists in the media have been urging.

During Wednesday's ceremony, the military chief of staff, appointed last month, rose up from his front-row seat and stood in rigid attention as el-Sissi, a general-turned-president, addressed him.

"I am mandating Maj. Gen. Mohammed Farid Hegazy before you and the entire people of Egypt to restore security and stability in Sinai," el-Sissi said. "With God's benevolence and your efforts and sacrifices, you and the police will restore security and use all brute force, all brute force."

It was not immediately clear what more the military and police could do to crush the insurgency.

The military has thrown tanks, fighting vehicles, fighter-jets, warships and helicopter gunships along with tens of thousands of security forces at the extremists in three years of conflict. Northern Sinai has been under emergency law for several years and security forces have forcibly evacuated areas adjacent to the border with Gaza, razing residents' houses and farmlands. They also have blown up underground tunnels that authorities believe jihadis used to smuggle weapons and fighters in from neighboring Gaza, ruled by the Palestinian militant group Hamas.

Friday's terrorist attack on the mosque in the northern Sinai village of al-Rawdah was the deadliest against civilians by Islamic extremists in Egypt's modern history. Among the 305 dead were 27 children; another 128 people were wounded.

The Islamic State group hasn't claimed responsibility for the attack but the gunmen who unleashed explosives and gunfire to mow down the worshippers during prayers carried the black banner of the IS. The mosque belonged to followers of Islam's mystical Sufi movement, considered heretics by IS and other extremist groups. Militants have in the past targeted them in Sinai as well as elsewhere, like in Iraq.

El-Sissi has frequently said that Islamic militants have benefited from the care his security forces routinely take to ensure that civilians are not caught in the cross-fire. But rights groups and Sinai activists have in the past spoken of civilians enduring collective punishment, usually in the aftermath of major attacks, and of hardships resulting from military operations, including lengthy power, water and phone signal outages.

Giving his security forces a three-month deadline to crush the insurgency in Sinai may turn out to be a risky gamble by el-Sissi, who is widely expected to seek a second, four-year term in office in elections due next year. Failure would dent his standing since he won office in a 2014 election landslide with promises of restoring security.

However, only state-owned Egyptian media with unquestionable loyalty to the government are allowed to travel to northern Sinai, leaving authorities in near-total control of the narrative on how the war there is going. Against the backdrop of such restrictions, an absence or a continuation of attacks by militants during the next three months and after would likely be the best indicator of how the fight is going.

Egypt's security forces have for years been waging a tough and costly campaign against militants in the towns, villages and desert mountains of northern Sinai. In the past year, militants have bombed churches in the capital of Cairo and other cities, killing dozens of Christians, as they slowly took the fight to the mainland.

A local affiliate of the extremist Islamic State group now spearheads the insurgency. It is believed to have been behind the October 2015 downing of a Russian passenger jet that killed all 224 people on board, decimating the country's vital tourism sector.

The insurgency has gathered steam following the 2013 ouster by the military, then led by el-Sissi, of Mohammed Morsi, an Islamist president whose one year in office proved divisive. Also, a series of recent attacks in Egypt's vast Western Desert suggests that a new front has opened. Authorities believe attacks there are carried out by militants based and trained in neighboring Libya.