The CIA says the so-called Islamic State is undiminished by almost two years of war, and will step up terrorist attacks worldwide as it loses territory in Iraq and Syria.

Calling ISIS a “formidable, resilient” enemy, CIA director John Brennan said the group will likely switch to guerrilla tactics as it is driven off the battlefield and will send more of its Western operatives to attack Europe and beyond, while using social media to groom future lone wolves like U.S.-born Omar Mateen, 29, who killed 49 people Sunday in Orlando.

“Our efforts have not reduced the group’s terrorism capability and global reach,” Brennan told the Senate Intelligence Committee in grim testimony Thursday, just days after the gay nightclub attack, apparently inspired by ISIS.

Brennan’s testimony amounted to a failing grade for Obama administration efforts to check the ISIS’s spread, despite an almost two-year barrage of U.S. air strikes and ground assaults in Iraq and Syria that have cost the group significant territory. Brennan described ISIS’s cancer-like consumption of other regional militant organizations in Libya, Egypt, and Africa, folding them into a single bloodthirsty ideology that takes root wherever there is chaos.

“The group would have to suffer even heavier losses of territory, manpower, and money for its terrorist capacity to decline significantly,” he said, making what could be seen as an oblique call for the White House to step up its efforts if it hopes to hobble ISIS.

In the aftermath of the Orlando massacre, the presidential candidates appear to agree on the need to step up the war. Hillary Clinton said Monday the U.S. must “defeat ISIS.” And Donald Trump has, in the past, refused to rule out using nuclear weapons against ISIS.

ISIS has lost territory—45 percent in Iraq and between 20 percent and 30 percent in Syria, according to U.S. military estimates—and it has had trouble replenishing its ranks in Iraq and Syria. The group is currently battling to keep its grip on the Iraqi city of Fallujah, which has been penetrated by Iraqi forces on the city’s southern side.

In Syria, U.S.-backed Kurdish and Arab forces have encircled the city of Manbij, a key throughway between Syria and Turkey. And in the ISIS capital of Raqqa, local forces, with U.S. support, have come with 20 miles of the city.

Yet the military pressure on the group is only expected to drive a faster evolution.

“ISIL…is a formidable, resilient, and largely cohesive enemy, and we anticipate that the group will adjust its strategy and tactics” to regain momentum, Brennan said, using the administration’s preferred acronym for the group.

That adjustment has already occurred, with the November Paris attacks and the March attacks in Brussels, as well as a surge of terrorist attacks in Iraq and Syria. The spate of bombings in Baghdad over the past month has killed at least 300, including 31 last Thursday.

The CIA chief’s pessimism has been echoed in the halls of the Pentagon, as ISIS transforms itself into something a traditional military has trouble defeating. Now it is becoming less a self-proclaimed state and more of a terror group that maintains its influence through shocking attacks and bombings, three defense officials explained to The Daily Beast. They spoke anonymously to discuss confidential Pentagon discussions of how to defeat ISIS.

The group is even trying to redefine what it means to win. An ISIS spokesman last month redefined defeat as the “loss of willpower and desire to fight” and urged lone wolf attackers to strike.

“The smallest action you do in their heartland is better and more enduring to us than what you would if you were with us. If one of you hoped to reach the Islamic State, we wish we were in your place to punish the Crusaders day and night,” Abu Muhammad al-Adnani said.

Brennan said the CIA has found no clear link between the Orlando shooter, Mateen, and ISIS, echoing the White House and FBI.

Yet the terror group was eager to take credit, especially after reports emerged that Mateen pledged allegiance to ISIS shortly before the attack through a 911 phone call to the Orlando police department. Mateen then charged into Pulse nightclub, armed with a handgun and an assault rifle, and killed patrons over a three-hour period before being killed himself by police officers.

“ISIS claimed the attack very quickly. It took the risk because their situation has changed,” said Michael Horowitz, a geopolitical and security analyst at the Levantine Group, a Middle East-based risk consultancy. “They are facing a lot of military pressure from the U.S.-backed Kurds, from the Iraqi government, and from [Syrian President] Bashar al-Assad.”

“I don’t think we would have seen ISIS taking that risk a year ago. They can’t afford the chance to miss an opportunity. They need this to boost morale,” Horowitz added, in an interview with The Daily Beast.

Officials note that claiming credit comes at little cost to ISIS and potentially bolsters the morale of a group facing attacks on multiple fronts.

“It’s a small opportunity cost,” a U.S. official explained.

The battlefield losses have done little to stem the group’s popularity, especially in places where the governments and local security are weak or challenged, like Africa and parts of Asia, Brennan said.

“Libya is the most dangerous branch of ISIL outside of Iraq,” Brennan said. “I am concerned about Libya as another area that could serve as a basis for ISIL to carry out attacks on Europe and other locations.”

The group, he said, now controls areas outside the Libyan city of Sirte, which he fears could be used as a springboard to launch attacks on Europe.

Brennan called the ISIS branch in the Sinai “the most active” and acknowledged that the U.S. government holds the Sinai branch responsible for bringing down a Russian passenger airliner last year.

“There’s great concern about how ISIL has been able to consume and co-opt other groups,” he said.

He estimated ISIS’s ranks in Iraq and Syria at between 18,000 and 22,000 fighters, down from 33,000 last year, but ticked off a grim tally of the group’s spread: 5,000 to 8,000 in Libya; up to 1,000 inside Egypt and the Sinai; several hundred in Yemen; and hundreds in Afghanistan and Pakistan.

“The group’s foreign branches and global networks can help preserve its capacity for terrorism,” regardless of what happens in Iraq and Syria, he said.

“The true novelty of ISIS was not that it was able to carry out attacks but that it was able to take territory,” analyst Horowitz said. “The destruction of ISIS in Iraq and Syria won’t lead to its demise. Their ideology will continue to inspire.”

Or as a second U.S. official explained: ISIS is becoming a “virtual caliphate.”