– Thousands of Muslims vented their anger in unison, shouting “Allahu akbar!” as their leader condemned supporters of the satirical magazine Charlie Hebdo after militants murdered five of its cartoonists.

The protest against caricatures of the prophet Mohammed and the policies of the U.S. and its allies was organized by the state and televised live across the country, but it wasn’t in Iran or Pakistan. It was in Russia, where Vladimir Putin came to power vowing to “wipe out” Muslim extremists.

Fifteen years later, Putin is now seeking to turn Muslim anger to his advantage by pushing for a united front against what he sees as a U.S.-led conspiracy to dominate the world. Putin is also trying to neutralize the threat posed by the return of Russian jihadis currently fighting for the Islamic State in Iraq and the Levant, a task complicated by his growing isolation over the war in Ukraine.

“The protest was an attempt to meld Muslim opinions with Russian-wide views about the Western world, a lever to unite the population around Putin,” said Alexei Malashenko, a Middle East analyst at the Moscow Carnegie Center.

The rally last month was held in Grozny, the capital of Chechnya, where thousands of people died in Russia’s two wars against separatists.

Ramzan Kadyrov, the Putin loyalist who runs the region, told the crowd “Western agents” probably organized the Charlie Hebdo killings to trigger a “new wave” of ISIL recruits for their war on Islam. Kadyrov, 38, has said the U.S. secretly controls ISIL.

Chechnya is the only one of the seven regions in the North Caucasus area where the death toll from battles with extremists rose last year, to 52, according to Caucasian Knot, a Moscow-based analysis and news group. Almost 10 million people, mainly Muslims, live in the district, which borders Azerbaijan and Georgia and is closer to Syria than Moscow.

Radicals from Chechnya have claimed credit for some of the most brutal acts of terrorism in Russia. They include the 2002 hostage-taking at a Moscow theater, which led to 170 deaths, the 2004 seizure of a school in Beslan that resulted in more than 380 fatalities and the dual suicide bombings in Moscow subway stations in 2010 that killed at least 40.

Distracted by war, economy

Putin is facing the threat of resurgent radical Islam on Russia’s southern flank at a time when his security forces are focused on Ukraine and the economy is reeling from sanctions and plunging oil revenue.

The issue became more urgent in December when militants staged the deadliest attack in Chechnya in four years. They stormed a police outpost and seized buildings in Grozny, culminating in an hourslong shootout that left more than 20 dead. The operation coincided with Putin’s annual address to the nation.

“These rebels have showed up in Chechnya again,” Putin said that day. “I’m sure local law-enforcement authorities will take proper care of them.”

Russian officials are bracing for an upsurge in violence across the North Caucasus now that ISIL has declared Russia an enemy for arming Syrian President Bashar Assad, who’s locked in a civil war. About 1,500 Russians have fought for the group and many of them are returning.

“Russia is the Islamic State’s new target,” Caucasian Knot chief Grigory Shvedov said. “The process has begun.”

At least three “emirs” in the Caucasus have pledged allegiance to the ISIL movement.

“It’s the most economically powerful and self-sufficient terrorist entity we’ve ever seen,” said Ilya Rogachev, who runs the Russian Foreign Ministry’s office of new challenges and threats. “And now they’re bearing heavy losses, so the outflow of militants is increasing. These people are coming back with warped psyches, ready to solve problems through violence.”

Targeting Russians

ISIL’s media arm last month released a video in which a boy appears to execute two men accused of spying for Russia’s Federal Security Service.

In November, Kadyrov said the ISIL commander known as Omar the Chechen had been killed in Syria after threatening to strike Russia.

Leonid Reshetnikov, who ran the information and analysis directorate at Russia’s Foreign Intelligence Service from 2005 to 2009, said the video looks fake. Still, ISIL’s message is real: “We will be as merciless with your agents as we are with the Westerners,” Reshetnikov said.

Putin visited Egypt for the first time in a decade on Feb. 9 to discuss ISIL and other issues with his counterpart, Abdel Fattah al-Sisi. While the group poses an “unprecedented” threat, the U.S. and its allies should bear responsibility for creating the conditions for its success, Putin told Egypt’s Al-Ahram newspaper.

Even so, Rogachev of the Foreign Ministry said it’s imperative that Russia, the U.S. and the European Union rebuild ties and work together to neutralize ISIL.

Without such cooperation, attacks like the one on Charlie Hebdo will only increase in severity and frequency, according to Anatoly Kulikov, a former interior minister who commanded Russian troops during the first war in Chechnya in the 1990s.

“That was a very serious signal that we should stop quarreling and join efforts,” Kulikov said.