An image from a video released by the Egyptian Defence Ministry on Friday shows Egypt’s army spokesman, Colonel Tamer al-Rifa, announcing the launch of a major operation in the Nile Delta and in Sinai against a persistent Islamic State group insurgency. (Ho/Agence France-Presse/Getty Images)

Egyptian security forces launched a major military operation against a tenacious Islamic State affiliate in the country’s restive northern Sinai Peninsula and other areas on Friday.

In ordering the most comprehensive offensive in years, the government has called on all branches of the security forces to respond. Soldiers and police were dispatched to tighten control of land borders, and warships were deployed along the coast to “cut the terrorists’ supply lines and ensure they do not get backup,” the military said in a statement.

The offensive’s goal, the military added, was to “tighten control of the country’s crossing points with neighboring countries and to cleanse the areas that are terrorist strongholds to safeguard the Egyptian people from the evils of terrorism and extremism.”

The military operation comes ahead of a presidential election next month and as Islamist extremists continue to stage attacks around the country.

The offensive marks the most ambitious effort yet by President Abdel Fatah al-Sissi to tackle the Islamic State’s Sinai branch, one of several deadly affiliates that are seeking to fill the void left by the group’s recent defeats in Syria and Iraq. Less than three months ago, Islamic State militants were widely believed to have killed more than 350 people at a mosque in the northern Sinai. That prompted Sissi to issue an ultimatum to the security forces to put an end to terrorism and extend a state of emergency in January for three more months.

“I follow with pride the heroic actions of my sons in the armed forces and police to clear Egypt’s territory of terrorist elements,” Sissi posted on his Facebook page Friday.

The number of terrorist attacks has been at its highest since the 1990s, when Islamist extremists launched regular assaults on police, tourists and government officials. That prompted a severe crackdown by the security forces of then-President Hosni Mubarak. Thousands of suspected Islamists were arrested, deported or executed.

The violence began in the summer of 2013 after Egypt’s military overthrew the elected Islamist president Mohamed Morsi. The following year, months after Sissi took office, militants in the northern Sinai pledged allegiance to the Islamic State. Since then, the affiliate, known as Wilayat Sinai, has killed hundreds of Egyptian soldiers in a guerrilla war.

In recent months, even as Egypt’s military claims to have killed more than 2,500 militants, the attacks have spread to other parts of the country. Friday’s operation stretched into the Nile Delta and the Western Desert, and it appears that other Islamist extremists and criminal groups also are being targeted.

[How an Egyptian village became a target of the Islamic State]

With the Islamic State all but defeated in Syria and Iraq, Egypt and its neighbors are concerned that the northern Sinai could become a haven for the group and a staging ground for operations across the region, fueling political and economic instability.

Israel, which shares a border with Sinai, has been working with Sissi’s government to fight the ISIS branch, including staging dozens of attacks inside Sinai with unmarked Israeli warplanes and helicopters in recent years, according to former senior U.S. officials. The covert attacks, first reported by the New York Times, were carried out with Sissi’s support.

A spokesman for the Israel Defense Forces declined to comment on whether Israel was involved in the current offensive or providing air support.

An Egyptian military spokesman denied any Israeli air attacks had taken place in Sinai.

The offensive comes as Sissi’s popularity has declined amid economic austerity measures, rising prices and high unemployment. He has either arrested or sidelined all credible challengers in next month’s presidential election, essentially ensuring his reelection. By going after the Islamic State, Sissi is hoping to regain popular support, Western diplomats suggest.

The Islamic State has particularly targeted Egypt’s Coptic Christians, who make up about 10 percent of the country’s 94 million people. Over the past 16 months, there have been numerous bombings at churches across the country, killing scores of Christian worshipers. Many in the community voted for Sissi in the 2014 elections but in recent months have publicly expressed anger at his government’s inability to protect their community.

In 2015, the Islamic State affiliate in Sinai claimed responsibility for the downing of a Russian passenger plane after it took off from the Red Sea resort town of Sharm el-Sheikh. That attack, which killed all 224 people aboard, shattered Egypt’s ­tourism-driven economy.

Preparations for Friday’s offensive began earlier in the week. Local media reported that the government had placed areas around Sinai on high alert and readied doctors and medical resources in hospitals in the northeastern city of Ismailia, on the edge of Sinai.

In a letter circulated on social media, Egypt’s ministry of health ordered the hospitals to prepare for casualties by emptying 30 percent of beds in intensive care units and orthopedic wards. Officials canceled all holidays for doctors, nurses and other medical staff.

According to Mada Masr, an independent Egyptian daily, large numbers of doctors were recently dispatched to compulsory postings across Sinai after being told by health officials that “something is going to happen in the area in the next few days.”

Loveday Morris in Jerusalem contributed to this report.