ANKARA/BEIRUT (Reuters) - Turkey has lost momentum in the war for northern Syria as the United States draws on Kurdish allies in the assault on Islamic State-held Raqqa, but Ankara is still pressing Washington for a deal that allays its fears of Kurdish ascendancy.

Syrian Kurdish groups meanwhile sense Washington is now more firmly behind them than before, a shift they hope will eventually aid their ambitions for autonomy after years of persecution by the Syrian government.

One of the most complicated theatres in the multi-sided Syrian conflict, the war in the north has played out at lightning pace in the last few weeks with Islamic State fighters either withdrawing or collapsing in swathes of territory.

The Russian-backed Syrian army has benefited from this, creating a corridor to the Euphrates River that secures Aleppo’s water supplies and suggests at least tacit coordination with U.S.-allied Kurdish militia - at Turkey’s expense.

In a swipe at Washington, Turkish Prime Minister Binali Yildirim said on Tuesday it was unfortunate that some of Turkey’s allies had chosen the Syrian Kurdish YPG militia as a partner in the fight against Islamic State in Syria.

“The field in Syria at the moment is really very complicated,” said a senior Turkish official, stressing the fast-moving nature of events and the urgent need for agreement. “Anything could happen at any moment.”

“Such a harsh step in completely excluding Turkey there will cause a problem for relations between the countries,” the Turkish official said. “Hence a share point must be found. Talks are still continuing.”

Turkey has seized a swathe of Syrian land on its southern borders since launching its “Euphrates Shield” operation in August. Its main aim was to prevent creation of a contiguous Kurdish-held corridor it fears could threaten its security.

The rise of Kurdish power in northern Syria has caused alarm in Ankara, which views the Kurdish groups there as an extension of the Kurdistan Workers’ Party (PKK) that has been fighting an insurgency on Turkish soil for over 30 years.

Turkey’s military chief this week discussed Syria with his U.S. and Russian counterparts. Turkish officials said the first day of talks had focused on ways to guarantee no inadvertent “friendly fire” clashes.

CONFLICTING AGENDAS

Ankara had hoped to advance its strategy in northern Syria by persuading Washington to abandon its Kurdish allies and switch support to Free Syrian Army (FSA) rebel groups for the final assault on Raqqa - a northern Syrian city that is Islamic State’s de facto capital.

But any hopes of this have faded in recent days.

Conflicting U.S. and Turkish agendas have surfaced clearly over Manbij, a city controlled by Kurdish-allied militia since its capture from Islamic State last year. A deployment of U.S. forces there last week deterred a threatened Turkish attack.

Foreign minister Mevlut Cavusoglu made clear Turkish sensitivities about the presence of Kurdish militia in Manbij, a town Ankara sees as the next stepping stone in creation of a safe zone free of Kurdish influence west of the Euphrates.

“We will not allow the YPG’s canton dreams (to come true),” NTV television cited Cavusoglu as saying. “If we go to Manbij and the PYD is there, we will hit them.”

The YPG says it withdrew from Manbij after helping to capture it last year, leaving it in the control of allied militia of the Syrian Democratic Forces - an alliance that includes the YPG and Arab fighters. Washington has built its strategy around the SDF.

The Pentagon said the aim of its Manbij deployment was to ensure different parties in the area did not attack each other.

The U.S.-led coalition has also deployed a U.S. Marines artillery unit to Syria in recent days to help defeat Islamic State at Raqqa. It said on Thursday SDF efforts backed by the coalition to isolate the city were going “very, very well”.

A top U.S. commander last week also gave an unusually robust defence of the YPG, saying he had seen no evidence linking them to attacks on Turkey and signalling some role for them in the final push for Raqqa - a predominantly Arab city.

U.S. military ties with the YPG have deepened since the U.S.-led coalition first provided air support to defeat Islamic State in the Kurdish town of Kobani two years ago.

With U.S.-led coalition air support and special forces backing on the ground, the SDF has been gradually encircling Raqqa since November. This week, it cut the last main road from Raqqa to the jihadists’ stronghold of Deir al-Zor.

Apart from the pocket of territory held by Turkey, the YPG and its political affiliate the PYD control areas of northern Syria all the way to the border with Iraq. They also control a corner of northwestern Syria at the Turkish border.

Senior Syrian Kurdish official Aldar Xelil told Reuters that recent events showed Washington was telling Ankara: “Look, these are your limits”. “It appears that the Americans have made up their minds”, he told Reuters in a phone interview from the Kurdish-dominated city of Qamishli in northeastern Syria.

“EUPHRATES SHIELD” NOT OVER

Xelil foresaw eventual U.S. political engagement with the Syrian Kurdish groups - something Washington has largely avoided so far. In line with Turkish wishes, the PYD has been consistently left out of U.N.-led peace talks on Syria.

“Let’s say tomorrow Daesh is finished - and it will be - what about the political solution. Won’t they ask what is the solution? It needs a plan, and the most reasonable one is a federal one based not on ethnicity or religion but geography.”

Washington has stated its opposition to the Kurdish-led autonomous zones in northern Syria, even as it backs the YPG militarily. Kurdish groups aim to preserve their autonomy as part of a federal system of government they say is the only way to settle the conflict. They say independence is not their aim.

The SDF informed U.S. officials last month of its rejection of any Turkish role in Raqqa, the SDF spokesman told Reuters.

Coalition spokesman Colonel John Dorrian told Reuters a possible Turkish role remained “a point of discussion at military leadership and diplomatic levels”. The discussion would continue “to whatever logical end there is”, he said.

Turkey still hopes Washington will be forced to draw on its support in one way or another.

A scenario mapped out in the Turkish newspaper Hurriyet saw Turkish special forces deploying alongside U.S. special forces, FSA groups, Arab components of the SDF, and Iraqi Kurdish forces.

But such a plan would need to navigate the hostility between the SDF and FSA, which have fought on and off across northern Syria for more than a year, and enmity between the main Syrian and Iraqi Kurdish groups.

Away from the battlefield, Turkish President Tayyip Erdogan cannot afford to appear to have been pushed aside in his campaign to secure Turkey’s frontiers. He faces an April referendum on sweeping new powers he deems vital to a country facing spillover of Islamic State violence from Syria.

Erdogan, who has been one of the foremost critics of President Bashar al-Assad, is due to fly to Moscow on Friday for talks with President Vladimir Putin.

A senior Turkish official cautioned that Turkey’s intervention in Syria was not yet over.

“At this stage, the Euphrates Shield operation has not been completed. We are discussing the next step with our allies,” the official said. “The U.S. side made some promises for this before and we believe that they will provide this support.”