ISTANBUL (Reuters) - The rapid advance of U.S.-backed Kurdish fighters in northern Syria, taking advantage of Russian air strikes to seize territory near the Turkish border, has infuriated Ankara and threatened to drive a wedge between NATO allies.

Buildings which were damaged during the security operations and clashes between Turkish security forces and Kurdish militants, are pictured in Sur district of Diyarbakir, Turkey February 11, 2016. REUTERS/Sertac Kayar

Washington has long seen the Syrian Kurdish Democratic Union Party (PYD) and its YPG military wing as its best chance in the battle against Islamic State in Syria - to the chagrin of fellow NATO member Turkey, which sees the group as terrorists and fears it will stir up greater unrest among its own Kurdish minority.

Russian bombing has transformed the five-year-old Syrian civil war in recent weeks, turning the momentum decisively in favor of Moscow’s ally President Bashar al-Assad.

The Syrian army has come within 25 km (15 miles) of the Turkish border and says it aims to seal it off altogether, closing the main lifeline into rebel territory for years and recapturing Aleppo, Syria’s largest city before the war.

Meanwhile, the YPG has exploited the situation, seizing ground from other Syrian opposition groups in the area.

Washington says it does not believe the Kurds are coordinating directly with Moscow. But the YPG’s advance may represent a masterstroke by Russia, which could benefit from any discord between NATO allies Turkey and the United States.

“Now this is the YPG’s dilemma: Will it continue with America or Russia? The consequences of this strategic choice will influence Syria’s future, as well as the ongoing clashes in Turkey,” said Metin Gurcan, an independent security analyst and retired Turkish military officer.

Turkey has shelled YPG positions inside Syria for four straight days. Ankara sees the militia as an extension of the outlawed Kurdistan Workers Party (PKK), which has fought a three-decade insurgency for autonomy in Turkey’s mainly Kurdish southeast.

Turkey also portrays the Kurds as a pawn of Russia. Relations between the former Cold War rivals hit a low last year after Turkey shot down a Russian warplane over Syria.

Turkey now accuses Russia of deliberately targeting civilians in Syria, including hospitals struck this week, in what it calls a “war crime” to depopulate territory ahead of a government advance. Moscow denies this and accuses Turkey of covertly supporting Syrian jihadist militant groups.

The United States, which has supported the Kurdish fighters elsewhere in battle against Islamic State, has called for the YPG to stop actions that would heighten friction in northern Syria. It has also urged Ankara to stop shelling YPG positions.

Washington has seen no evidence that the YPG are cooperating with the Russians, U.S. State Department spokesman Mark Toner said at a briefing this week.

DECADES OF REPRESSION

Some 30 million Kurds are estimated to live in Iran, Turkey, Iraq and in Syria. Syria’s Kurds are the largest ethnic minority and suffered decades of repression under President Bashar al-Assad and his father before him.

Under the Damascus regime, Kurds were forbidden from learning their own language, frequently evicted from their land and even denied full citizenship. Their region is home to a chunk of Syria’s estimated 2.5 billion barrels of crude oil reserves, but Kurds enjoyed little benefit.

Now, Kurds have started to carve out a fiefdom in the north of fragmenting Syria, similar to the autonomy enjoyed by their kin in northern Iraq.

“Russia is using this instrument to put Turkey in a difficult position,” Turkish Prime Minister Ahmet Davutoglu said this week, vowing to prevent the YPG from expanding its territory.

In the early stages of Syria’s civil war, there were signs Turkey was willing to work with the PYD and other Kurdish groups if they met three demands: remain resolutely opposed to Assad, vow not to seek autonomy through violence or before the wider conflict was resolved, and pose no threat to Turkey.

“We have no problem with their aspirations ... What we do not want from any group is that they use this situation opportunistically to impose their will by force,” a senior Turkish government official told Reuters in August 2013, days after PYD co-chair Saleh Muslim was invited to Istanbul for talks.

RELATIONS SOUR

But relations soon deteriorated, reaching a nadir in late 2014, when Islamic State fighters besieged the predominantly Kurdish town of Kobani on the Turkish border for four months as Turkish tanks looked on from surrounding hills.

Turkey allowed Iraqi Kurdish peshmerga forces through its territory to help defend the town, but its failure to intervene directly in support of the YPG, even as a U.S.-led coalition carried out air strikes against Islamic State, infuriated Kurds in both Syria and Turkey.

That added to pressure on the Turkish government’s relationship with its own Kurds. PKK attacks on Turkish security forces last year helped put an end to a more than two-year ceasefire between the government and the insurgents, and the once-dormant conflict within Turkey has since stayed hot.

Wary of an escalation, Washington has urged all parties to focus on the “common threat” of Islamic State, calling on Turkey to cease cross-border artillery fire and on the YPG not to seize new territory from groups that Turkey supports.

Turkey has repeatedly criticized the United States for its position, saying that Washington should deem the Syrian Kurds terrorists, as it does with the PKK, and halt support.

The Syrian Kurdish militia has not explained the aim of its latest advance but a source told Reuters on Jan. 28 it planned to seize the stretch of border held by Islamic State east of Azaz - the only part of the frontier still in the hands of the jihadist group.

But the YPG’s advance into territory held by other rebel groups looks likely to continue for now, causing headaches for Washington as it tries to manage its strategic relationship with Turkey and check Russia’s influence in the region.

“The YPG is pushing as far as it can.… (Its) focus right now is making the most of its momentum,” said Gurcan, the analyst. “This has put the U.S. in a very bad position.”