By Angus McDowall, Orhan Coskun and Ulf Laessing
TUNIS/ANKARA/CAIRO (Reuters) - As Turkish drones helped drive eastern Libyan forces back from Tripoli this month, Russia was said to be reinforcing them with warplanes, raising the stakes in a stalemated civil war that has partitioned the country.
Recent weeks have marked a turning point in a complex conflict between two uneasy coalitions that are each backed by an array of foreign states whose competing regional agendas make them unwilling to countenance defeat.
Eastern commander Khalifa Haftar and his Libyan National Army (LNA) now face the likely failure of their year-long effort to capture Tripoli, seat of the internationally recognised Government of National Accord (GNA).
Backed by the United Arab Emirates, Russia and Egypt with arms, mercenaries and air strikes, according to U.N. experts, Haftar had last summer advanced into Tripoli's southern suburbs before his offensive stalled.
However, aid from Turkey helped turn the tide with air defences and drone strikes that neutralised LNA air power before hammering its ground troops and long supply lines this month.
"In the last few weeks, there has been a significant change in balance in Libya," said a senior Turkish official, crediting Turkish drones and "untrained soldiers" operating LNA air defences.
It led, over the past month, to the LNA's sudden loss of a string of towns near the Tunisian border, a crucial air base, a dozen of its own air defence systems and most of its foothold in Tripoli. With them went Haftar's hopes of victory.
Over the same period, Russian military personnel have delivered some 14 MiG 29 and Su-24 fighter jets to the LNA's Jufra air base in central Libya, the U.S. military said this week. They are aircraft that could again turn the tide of war.
A Russian member of parliament and the LNA have denied the aircraft arrived.
Libya is once more on the brink after years of chaos that followed the uprising against Muammar Gaddafi in 2011, leading to rival administrations in Tripoli, in the west, and Benghazi in the east.
With more arms and fighters flowing to local proxies, Libyans fear an unending conflict in which outside powers keep fuelling warfare to protect their interests, while suffering little pain themselves.
One Western diplomat working on Libya warned of a "stagnating conflict in which escalation is met with escalation, increasingly violent and with no resolution or way out".
France, which has also been broadly supportive of Haftar, warned this week that the situation in Libya risked replicating Syria's descent into an endless war driven by outside forces.
Russian and Turkish officials spoke last week and issued a statement agreeing on the need for a ceasefire, a possible sign they have hashed out a backroom deal to avert a direct confrontation after the arrival of the Russian jets.
"They put the gun on the table to signal to Turkey that there are limits to where its forces can advance towards the east," said a second Western diplomat working on Libya.
The jets at Jufra could now act as a deterrent to a new offensive by the GNA once it has consolidated its gains in the west said Wolfram Lacher of the German Institute for International and Security Affairs.
"It appears the purpose of these fighter jets and the redeployment to central and southern Libya now is to stabilise and freeze the military situation," he said.
With Haftar's offensive collapsing, and with it his wider project of uniting Libya by force and replacing the GNA, his role as the lynchpin of the eastern bloc is also in question.
"So much of Haftar's campaign and his narrative over many years has been built on success and momentum," said one of the diplomats.
In late April as his war stuttered, Haftar suddenly declared that his military would seize power nationally, a move that would sideline the civilian administration in east Libya that had recognised him as head of the army there.
But he did not follow through by forming a new government - apparently because he could not mobilise enough support among his own coalition in the east or from foreign backers.
In Cairo, where the priority is stability in eastern Libya, diplomats said there was some impatience with his war in the west. However, "Haftar is still popular in the east," said a former senior official.
"I don't think his power structure is going to collapse overnight in the east," Lacher said.
However, the repercussions of his failure to take Tripoli will be felt, Lacher added. "All of this makes a combustible mix that could produce challenges to Haftar's authority eventually."
(Reporting By Angus McDowall in Tunis, Orhan Coskun in Ankara, Ulf Laessing in Cairo, Andrew Osborne in Moscow and Ghaida Ghantous in Dubai; Editing by Giles Elgood)