In the global revulsion at the past week’s terror attacks in four Muslim countries, the United States and its allies have a new opportunity to build a unified command against Isis and other extremists.

But as the US seeks to broaden this counter-terrorism alliance, it should be careful about partnering with Russia — unless Moscow distances itself from a Syrian regime that many Sunni Muslims despise.

The savage attacks in Turkey, Bangladesh, Iraq and Saudi Arabia should convince Muslim nations and the West that they share a common enemy in extremist groups such as Isis.

Suicide bomber kills at least four in attack on Prophet's Mosque in Saudi Arabia

What they need now is a shared command-and-control structure, like what the US and Britain forged in December 1941, after the shock of Pearl Harbor. Merging military and intelligence resources wasn’t easy, even for longstanding partners in Washington and London. But Prime Minister Winston Churchill knew that once America had fully joined the battle, the allies’ eventual victory was certain.

Similar confidence would be inspired by a command structure that truly fuses the resources of the US, Europe, Turkey, Iraq, Saudi Arabia, Indonesia, Pakistan and the many other nations that have been targeted by Islamic State terrorists.

A sign of how unpopular these attacks are with Muslims is that Isis isn’t taking credit for the attacks in Turkey and Saudi Arabia — even though it’s widely seen as the likely perpetrator — and that other Islamist groups are condemning the violence, especially the bombing in the holy city of Medina.

In pictures: Baghdad bombing Show all 20 1 /20 In pictures: Baghdad bombing In pictures: Baghdad bombing Mourners react during a funeral of a victim who was killed in a suicide car bomb in the Karrada shopping area in Baghdad REUTERS In pictures: Baghdad bombing Mourners react during a funeral of a victim who was killed in a suicide car bomb in the Karrada shopping area in Baghdad REUTERS In pictures: Baghdad bombing Mourners carry the coffin of their relative, who was killed in a suicide vehicle bomb in the Karrada shopping area in Baghdad REUTERS In pictures: Baghdad bombing Iraqis react as they visit the aftermath of a massive bombing in Baghdad AFP/Getty Images In pictures: Baghdad bombing The mother (2nd L) of 16-year-old Iraqi Nabil Abdul Karim, who died in a massive bombing in Baghdad's Karrada neighbourhood as he went to celebrate his birthday, reacts as she visits the aftermath of the attack AFP/Getty Images In pictures: Baghdad bombing An Iraqi woman cries as she visits the aftermath of a massive bombing in Baghdad AFP/Getty Images In pictures: Baghdad bombing Iraqis react as they visit the aftermath of a massive bombing in Baghdad AFP/Getty Images In pictures: Baghdad bombing Iraqis gather at the site of a suicide car bombing in Baghdad's central Karrada district AFP/Getty Images In pictures: Baghdad bombing People light candles at the scene of a massive car bomb attack in Karrada, a busy shopping district where people were shopping for the upcoming Eid al-Fitr holiday, in the center of Baghdad AP In pictures: Baghdad bombing People light candles at the scene of a massive car bomb attack in Karrada AP In pictures: Baghdad bombing People light candles at the scene of a massive car bomb attack in Karrada AP In pictures: Baghdad bombing Iraqi women stand at a site barricaded with a security red tape in Baghdad AFP/Getty Images In pictures: Baghdad bombing Iraqis evacuate a body from the site of a suicide car bombing in Baghdad AFP/Getty Images In pictures: Baghdad bombing Firemen inspect the site of a suicide car bomb in the Karrada shopping area REUTERS In pictures: Baghdad bombing Iraqi firefighters spray water on a burning building at the site of a suicide car bombing claimed by the Islamic State group AFP/Getty Images In pictures: Baghdad bombing People gather at the site of a suicide car bomb in the Karrada shopping area REUTERS In pictures: Baghdad bombing Iraqis evacuate a body from the site of a suicide car bombing in Baghdad AFP/Getty Images In pictures: Baghdad bombing Iraqi women walk past a damaged building at the site of the attack AFP/Getty Images In pictures: Baghdad bombing Iraqis removed a burnt car from the site of the attack AFP/Getty Images In pictures: Baghdad bombing Iraqi firefighters extinguish a fire as civilians gather after a car bomb at a commercial area in Karrada AP

On Tuesday the SITE Intelligence Group gathered some of the online ripostes from rivals of Isis. An Australian cleric named Abu Sulayman, who is a member of Al Qaeda affiliate Jabhat al-Nusra, tweeted: “The #MedinaBlast is a criminal act that Muslims must condemn.” Another pro-Al Qaeda account tweeted: “[I]f Isis is not behind the attacks in Istanbul and Medina they should deny their involvement.”

Saudi Arabia had a similar wake-up call several years after Sept. 11, 2001, when the kingdom’s leaders realized that Al Qaeda terrorists were targeting the House of Saud, too. That led to joint operations against Al Qaeda by the kingdom’s counter-terrorism service and the CIA. Monday’s attacks in Medina, Jeddah and Qatif should deepen that cooperation—and draw in other Arab partners, such as Jordan, Egypt, Morocco and the United Arab Emirates.

The US has a chance to hit the “restart” button with Turkey, too. Turkish President Recep Tayyip Erdogan has been straddling the issue — condemning Isis but failing to close his border with Syria because of pique over U.S. support for Syrian Kurdish fighters. Now that Erdogan can see the jihadist dagger at his throat, he should want closer military and intelligence links with Washington. He should also think about reopening negotiations with the Kurdish Workers Party, or PKK, so that he’s not fighting a two-front war against terror.

What about Russia? Should Moscow and Washington join forces against terrorism? On one level the answer is obviously yes. Foreign fighters have been streaming from Russia and its former republics to join Isis. Two of the three attackers in Istanbul appear to have been Russians. Real cooperation would be useful, so long as it doesn’t condone and reinforce Russian bad behavior.

Syria is the test case: The Russians have been asking the U.S. for months to share targeting information about Isis and Jabhat al-Nusra positions in Syria, so that Russian forces can attack the jihadists and avoid hitting groups that, in theory, are working with the U.S.

The Obama administration is now debating whether to endorse such Russian-American sharing of targeting intelligence. The US military, seeing aggressive Russian behavior in Europe, is wary.

Administration officials who favor cooperation argue that it should come with a warning — that if Syrian forces continue bombing US-backed opposition groups, the US will strike back against the Syrians and take their jets out of the sky.

If Russia accepts such a real limitation on President Bashar al-Assad, then it should join the team. But if it continues unlimited support for Assad, Russia will only fuel the jihadists’ rage — and complicate American efforts to build a broader, unified command.

The terrorists who struck Istanbul, Dhaka, Baghdad and Medina made a potentially disastrous mistake. It may not look that way, after last week’s encounter with the metastasizing virus of Isis.

But the real goal of the jihadists has been to divide Muslims and the West. If the U.S. offers strong leadership now, it can repair that breach — and help organize a military and intelligence alliance against a common threat.