A DEADLY car bomb in Ankara on February 17th just a few hundred metres from Turkey’s parliament has fanned the flames of the war that Turkish troops are fighting against Kurdish insurgents in the country’s south-east. It also threatens to pull Turkey yet deeper into the chaos in Syria and to sour its relations with America. Most worryingly, it has brought Turkey one step closer to a direct confrontation with Russia.

On Thursday, Turkish officials identified the man who detonated a car packed with explosives next to a military bus in the heart of the country’s capital, killing 27 military personnel and one civilian, as a member of the People’s Protection Units (YPG), a Syrian Kurdish militia. “A direct link between the attack and the YPG has been established,” said Ahmet Davutoglu, the Turkish prime minister. He claimed the outlawed Kurdistan Workers’ Party (PKK), a Turkish-Kurdish group that has fought Turkey’s government for decades, provided logistical support for the attack.

The YPG has no history of attacks inside Turkey. It denied any role in the bombing, and said the government was blaming it as a convenient excuse for launching a military operation in Syria. A senior PKK commander claimed ignorance of the attack, but did not exclude the possibility that other Kurdish militant groups were involved. “We know that previously such acts have been carried out in retaliation for massacres in Kurdistan,” Cemil Bayik told a Kurdish news agency. The PKK has been battling government troops and police in Turkey’s south-east since last summer; the fighting has left hundreds dead, including over 200 civilians, and displaced more than 100,000 people.

Metin Gurcan, a military analyst and columnist for al-Monitor, a website, finds the PKK’s denial unconvincing. “They have a record of trying to franchise violence without taking responsibility,” he says. “They may be trying to export the violence [from the south-east] to the west of the country."

On Thursday, a PKK roadside bomb killed six troops in Diyarbakir, a south-eastern province. The same day, Turkish jets pounded PKK bases in the highlands of northern Iraq.

The Ankara bombing has widened the rift between Turkey and its allies over the YPG. Turkey, which regards the group as a front for the PKK, wants America to suspend its co-operation with the militia in Syria. But Washington considers the YPG an important partner in the war against Islamic State (IS). It has acknowledged ties between the YPG and the PKK, which it labels a terrorist group, but refuses to place the two in the same category.

Since the attacks, Mr Davutoglu has doubled down. “We cannot excuse any NATO ally, including the US, of having links with a terrorist organisation that strikes us in the heart of Turkey,” he said on Thursday. The same day, his ministry of foreign affairs summoned the ambassadors of the five permanent members of the UN Security Council.

Turkish warnings appear to be falling on deaf ears. Late on Thursday John Kirby, a spokesman for the State Department, suggested that Ankara had yet to provide conclusive proof of the YPG’s involvement in the attack. He also ruled out ending American backing for the group. “I think I’ve said that they’ve been some of the most effective fighters against Daesh [IS], and they have been supported by the air from the coalition,” he said. “And going forward, I would expect that that sort of support…would continue.”

The two NATO allies will probably find a way out of the dispute. But the far deeper row between Turkey and Russia has now reached uncharted waters. Having traded threats since late November, when Turkey shot down a Russian jet that had briefly entered its airspace after a bombing run in Syria, the two sides are now embroiled in a proxy war. In past couple of weeks Russia has effectively provided the YPG with air cover, paving the way for the group’s advance against Ankara-backed rebel forces north of Aleppo. The Turks have responded by raining artillery fire on the YPG for several days in a row, hinting at a possible ground operation and allowing as many as 2,000 rebels to cross into Syria to check the Kurdish offensive.

On February 19th Mr Davutoglu stopped just short of accusing Moscow of engineering the bombing in Ankara. “I would like to warn Russia, which is giving air support to the YPG in its advance on Azaz [a key rebel stronghold], not to use this terrorist group against the innocent people of Syria and Turkey,” he said.

Meanwhile, the YPG has started to leverage its budding relationship with the Russians. In an interview, the head of the newly opened Syrian-Kurdish representation to Moscow, Rodi Osman, warned that any Turkish incursion into Syria would result in a “great war” with his hosts. “Russia will respond if there is an invasion,” he said. “This isn’t only about the Kurds, they will defend the territorial sovereignty of Syria.”

For that reason alone, a unilateral Turkish offensive in northern Syria has hitherto seemed highly unlikely. Whoever staged the Ankara bombing hopes to have made it less so. “For an actor, or a group of actors, who want to draw Turkey into Syria,” says Mr Gurcan, “this was the perfect attack.”