Its de facto capital is falling. Its territory has shriveled from the size of Portugal to a handful of outposts. Its surviving leaders are on the run.

.

But rather than declare the Islamic State and its virulent ideology conquered, many Western and Arab counterterrorism officials are bracing for a new, lethal incarnation of the jihadi group.

.

The organization has a proven track record as an insurgency able to withstand major military onslaughts, while still recruiting adherents around the world ready to kill in its name.

.

Islamic State leaders signaled more than a year ago that they had drawn up contingency plans to revert to their roots as a guerrilla force after the loss of their territory in Iraq and Syria. Nor does the group need to govern cities to inspire so-called lone wolf terrorist attacks abroad, a strategy it has already adopted to devastating effect in Manchester, England, and Orlando, Fla.

.

“Islamic State is not finished,” said Aaron Y. Zelin, who studies jihadi movements at The Washington Institute for Near East Policy. “I.S. has a plan, and that is to wait out their enemies locally in order to gain time to rebuild their networks while at the same time provide inspiration to followers outside to keep fighting their enemies farther away.’”

.

Even with the news on Tuesday that American-backed forces said they had captured Raqqa, the capital of the group’s self-declared caliphate, European counterterrorism officials were worrying about sleeper cells that may have been sent out well before the battlefield losses mounted.

.

In Iraq, where the group that became the Islamic State took root, security officials are bracing for future waves of suicide attacks against civilians. And even if governments are able to head off organized plots like the Paris attacks of 2015, officials around the globe concede that they have almost no way of stopping lone wolf assaults inspired or enabled by Islamic State propaganda that lives online.

.

“It is clear that we are contending with an intense U.K. terrorist threat from Islamist extremists,” Andrew Parker, the director of Britain’s MI5 intelligence service, said in a speech on Tuesday. “That threat is multidimensional, evolving rapidly, and operating at a scale and pace we’ve not seen before.”

.

American and European counterterrorism officials acknowledge that they do not know the exact capabilities the Islamic State retains, or how much the appeal of the group’s ideology has been dented by its string of heavy military defeats.

.

Gen. Joseph F. Dunford Jr., the chairman of the Joint Chiefs of Staff, predicted last month that the loss of territory would precipitate a loss of credibility. “We’ll continue to see reduction in territory, reduction in freedom of movement, reduced resources and less credibility in the narrative,” he told a Senate hearing.

.

Others are less sanguine. They point to a speech by the Islamic State spokesman Abu Muhammed al-Adnani, before his death in an American drone strike last year, urging the group’s followers to fight on as a lean, agile insurgency instead of the bureaucratic juggernaut it had become.

.

“True defeat is the loss of willpower and desire to fight,” he said. “We would be defeated and you victorious only if you were able to remove the Quran from the Muslims’ hearts.” …

.

…The first major attack in the United States claimed by ISIS, a foiled shooting at a Texas community center in 2015, was directed this way, according to a recent assesment by the Defense Intelligence Agency.

.

The Islamic State may also have undercover operatives or sleeper cells outside the Middle East. Senior American officials said last year that the group had sent hundreds of operatives to Europe and hundreds more to Turkey.

.

And the group has continued to sow chaos even as it has lost territory. In 2017 alone, it has claimed responsibility for three terrorist attacks in Britain that killed 37 people, the Istanbul nightclub bombing on New Year’s Eve that killed 39 people, and strikes in more than seven other countries.

.

As the group was losing Mosul, Iraq’s second-largest city, in August, it sent a van tearing through crowds in the heart of Barcelona, killing 13 people and loudly declaring its continued relevance.

.

It is also premature to assert that the Islamic State is running out of territory. While its footprint has shrunk in Iraq and Syria, it still controls close to 4,000 square miles along the Euphrates River Valley on both sides of the Iraq-Syria border. American and Iraqi military commanders believe the group’s core leaders have gone to ground in the largely barren areas along the border.

.

At the same time, ISIS branches in North Africa and Asia are still launching operations, and its camps in eastern Afghanistan remain largely intact, despite recent American airstrikes.

.

Some areas that were previously declared liberated have seen a return of ISIS fighters. In Libya, where the group was routed from a 100-mile stretch of coastline in late 2016, the militants recently posted a video showing their fighters manning a new checkpoint. And far from its roots in the Middle East, the group continues to grow in other corners of the world, including in the Philippines, where a local affiliate held the town of Marawi for month, and in West Africa, where the militants continue to grow their ranks, encroaching on areas formerly under Al Qaeda’s grasp.

.

If the Islamic State does decline, other jihadi organizations are poised to fill the vacuum.

.

Al Qaeda, whose appeal to young fighters had been largely been eclipsed by the tech-savvy new caliphate of the Islamic State, is vying for a comeback.

.

“The reason that the I.S. gained a big following quickly was that it appealed to the hotheads, those looking for instant gratification,” said Bill Roggio, a senior fellow at the Foundation for the Defense of Democracies who monitors terrorist groups. “That caliphate model is all gone, but Al Qaeda remains.” …

It has also been promoting a younger, charismatic new leader: Hamza bin Laden, 27, the son of Osama.“

„Iraqi Forces Retake All Oil Fields in Disputed Areas as Kurds Retreat by DAVID ZUCCHINO

.

BAGHDAD — Kurdish separatists in northern Iraq surrendered all disputed oil fields to Iraq’s military on Tuesday, retreating in the face of overwhelming force that appeared to halt, at least for now, their independence hopes from a referendum held less than a month ago.

.

In a swift and largely nonviolent operation that came a day after Iraqi forces reclaimed the contested city of Kirkuk from the Kurdish separatists, Baghdad’s troops occupied all oil-producing facilities that the separatists had held for three years, and which had become critical to the Kurdish autonomous region’s economic vitality.

.

The loss of those resources will erase billions of dollars in export earnings that has flowed to the Kurdish region from the sale of oil. Kurds took over the disputed areas adjacent to their region after Iraqi troops fled an assault by the Islamic State extremist organization in 2014.

.

Those areas were included in the Sept. 25 referendum in which the Kurdish region voted overwhelmingly for independence. The vote angered not only the central government in Baghdad and the United States, but also neighbors Turkey and Iran, which have sizable Kurdish populations.

.

The Iraqi military operation to retake the disputed areas was aided by an agreement with a Kurdish faction to withdraw from them peacefully.

.

The territorial surrender, and its economic importance, raised new doubts about the political future of the Kurdish president, Massoud Barzani, the driving force behind the referendum, who was clearly outmaneuvered by the Iraqi prime minister, Haider al-Abadi.

.

At a news conference in Baghdad on Tuesday, Mr. Abadi said the referendum “is finished and has become a thing of the past.”

.

Mr. Barzani and other supporters of the referendum “took a very bad situation and made it worse,” said Denise Natali, a Middle East specialist at the National Defense University in Washington.

.

“Barzani badly miscalculated,” she said. “He played it all wrong.” In his first public statement since Iraqi forces launched the takeover operation early Monday, Mr. Barzani blamed members of the rival Kurdish faction for having withdrawn from contested areas and said that had “unilaterally paved the way for the attack.”

.

Mr. Barzani seemed to warn Baghdad not to advance beyond those areas. “All resources will be allocated for the security and stability of the Kurdistan Region,” the statement said.

.

Nonetheless, it was unclear how much support Mr. Barzani had to back up his bluster. He is isolated in the Kurdish region, where Baghdad has cut off international flights. Iran and Turkey have moved to erase Kurdish control of border crossings.

.

Outgunned and outmanned by the Iraqi military, Kurdish fighters appeared to be in headlong retreat on Tuesday. A senior commander of Kurdish forces defending oil fields outside the city of Dibis, about 30 miles northwest of Kirkuk, said in a telephone interview that his troops had pulled out late Monday night as Iraqi troops closed in.

.

The commander, who asked not to be identified because he was not authorized to speak with journalists, said Kurdish forces, known as pesh merga, had received orders to leave Dibis from superiors in Erbil, the capital of the autonomous region.

.

Kurdish fighters and Iraqi government troops are both part of the American-led coalition battling Islamic State militants in Iraq.

.

The Americans did not interfere with the Iraqi military’s takeover of the Kurdish-held areas. The coalition and the United States Embassy in Baghdad urged both sides to avoid violence and focus on fighting the militants.

.

The United States had always made clear to Mr. Barzani that it opposed the referendum, saying it would foment ethnic conflict, destabilize Iraq and undermine the fight against the Islamic State. Baghdad took steps to isolate the landlocked Kurdish region after the referendum, with the help of Iran and Turkey, and then began the assault on oil-rich Kirkuk Province early Monday.

.

American troops were in the province but had no role in the Iraqi military operation, said Col. Ryan Dillon, the spokesman for the coalition in Baghdad.

.

The loss of the Kirkuk oil fields could cripple the Kurdish region’s economy, costing 70 percent of its daily oil production, said Luay al-Khatteeb, the director of the Iraq Energy Institute in Baghdad.

“You can’t sustain a state with just 30 percent of your oil production,” he said.

.

Kurdish operators produce 790,000 barrels a day, including 550,000 barrels from Kirkuk Province and other contested areas, Mr. Khatteeb said. The region exports 590,000 barrels a day, with the remainder used for domestic refineries and consumption.

.

Oil analysts say the region has earned about $8 billion a year from oil exports. Baghdad, which has accused the Kurds of stealing the oil, cut off federal payments to the Kurdish region in 2014.

.

The Iraqi military triumph over the Kurds came as the coalition continued to battle Islamic State militants clinging to a strip of desert land and the border city of Qaim, in western Anbar Province near the Syrian border. Iraqi forces, in some instances aided by Kurdish fighters, have driven the militants from most of Iraq since they took over nearly a third of the country three years ago.

.

Elsewhere in Iraq on Tuesday, Iraqi militia fighters allied with government troops took control of disputed areas in and around Sinjar, a northern region populated by Yazidis, a religious minority. A Yazidi militia commander in Mosul said pesh merga fighters withdrew from the area as part of a negotiated agreement.

.

More than 2,000 Yazidis were massacred in 2014 by Islamic State militants who enslaved Yazidi women and girls. The city of Sinjar was liberated in 2015 by pesh merga fighters backed by American airstrikes.

.

In the northern city of Mosul, a commander of Iraqi military units said in a telephone interview on Tuesday that the Iraqi government was negotiating with Kurdish leaders on a Kurdish withdrawal from disputed areas around Mosul near the Kurdish autonomous region.

.

The commander said pesh merga forces had already withdrawn from some local areas, known as the Nineveh plains in Nineveh Province. He asked not to be identified because he was not authorized to speak with journalists.

.

To the south, the Iraqi military command in Baghdad said Iraqi troops had taken over several disputed areas in Diyala Province held since 2014 by pesh merga forces, who withdrew early Tuesday.

.

In a sign that life in the city of Kirkuk was returning to normal, hundreds of families — most of them Kurdish — who had fled the city as Iraqi forces entered Monday began coming home.

.

Mr. Abadi has assured Kurdish civilians that they would be protected by Iraqi forces and federal and local police. Kirkuk, a multiethnic city of about one million, is roughly 45 percent Kurdish, 38 percent Arab, 15 percent Turkmen and 2 percent Christian.

.

Roads connecting Kirkuk to Baghdad and to Erbil, closed during the military operation, were reopened Tuesday.

.

“We are all Iraqis,” Maj. Mohammed Ismael, a commander with Iraqi government counterterrorism troops in Kirkuk, said in an interview. “Kirkuk is now back in the heart of Iraq.”

.

Ali Riyadh, 28, an Iraqi Army soldier dining at an expensive restaurant in Kirkuk on Tuesday, said: “We came to Kirkuk yesterday, and today I’m having lunch in this nice place. It was easier than we expected.”