People embrace each other at the entrance to Istanbul’s Ataturk airport early Wednesday following their evacuation after a blast. (Emrah Gurel/Associated Press)

As Turkey counts the death toll from the horrific terrorist attack at the Istanbul airport Tuesday, a Turkish government that has sometimes dragged its feet on U.S counter-terrorism policies appears to be standing firmly on the side of its Western allies in combating jihadist terrorism — a welcome sign for Washington.

Turkish Prime Minister Binali Yildirim said evidence suggests that the attack was the work of the Islamic State — which would put Turkey on the same side as Western governments that have struggled with the recent wave of Islamic State-inspired attacks in Paris, Brussels and Orlando. The Istanbul assault tactics — use of multiple bombers and explosives at a busy airport — were eerily similar to the Islamic State attack on the Brussels airport three months ago.

This terrible attack could mark a change if it brings Turkey more firmly into the camp fighting the Islamic State — a battle in which it has sometimes been a passive observer. The attack on Istanbul, a symbolic crossroads for the Muslim world, also underscores that Western and Muslim nations alike are targets of jihadist violence.

Turkish President Recep Tayyip Erdogan stressed solidarity with Western countries in his statement about the attack, saying it could have happened anywhere and showed that there was “no difference between Istanbul and London, Ankara and Berlin.” That’s the kind of unified message the United States has wanted to hear more from Turkey.

Because the Islamic State hasn’t issued any public statement asserting responsibility for the attack, assessing the terrorists’ motive is largely speculation at this point. But some little-noticed recent events might explain why the jihadists could have decided to strike now.

For more than two years, the Obama administration has been cajoling and pleading with Turkey to close a roughly 70-mile hole in its border with Syria, west of the Euphrates River, which has been a superhighway for extremist fighters, cash and supplies. The Turks have made counter-demands and complained about U.S. reliance on a Syrian Kurdish militia called the YPG, which the Turks claim (largely correctly) is an arm of the Kurdish nationalist group called the PKK that they claim is terrorist.

Just over a month ago, President Obama delivered an ultimatum to Erdogan: If you don’t close the border, we will. And in late May, the United States did indeed launch an offensive by about 3,000 fighters from a coalition known as the Syrian Democratic Forces against what’s known as the “Manbij pocket,” south of the Turkish-Syrian border. This attack, directed by U.S. Special Forces advisers on the ground, featured a mixed assault force that included Syrian Kurds from the YPG and Syrian Arab forces, partially answering Turkish complaints.

The assault against the Islamic State’s key gateway has been largely successful, U.S. commanders say. Manbij is surrounded, cutting the jihadists’ access between Turkey and Syria and the flow of what had been tens of thousands of foreign fighters, who in recent years have initially come through Istanbul’s Ataturk airport, the same spot that was targeted Tuesday. American sources say that more than 1,000 Islamic State fighters have been killed so far in the Manbij campaign.

The Turks have been uneasy about Manbij, but they haven’t publicly complained, and they’ve allowed the United States to fly daily bombing missions against Islamic State positions by A-10 “Warthog” ground attack aircraft, based at Incirlik Air Base in southern Turkey.

The Turks, in short, may have grumbled in public, but behind the scenes they have been fairly cooperative allies. Now they have gotten a gut punch in Istanbul, perhaps in retaliation against the Manbij operation. Again, they haven’t complained so far and have instead stressed Turkish solidarity with other nations fighting violent extremism.

The terrorists must have hoped their attack on a symbol of Turkey’s modern, interconnected economy would bring backbiting and recriminations. They were trying to drive a wedge. But so far, the split they may have wanted hasn’t happened.