CAIRO (BLOOMBERG) - Field Marshal Khalifa Haftar was expecting the Kremlin red carpet.
Instead, he was cooped up in a Russian Foreign Ministry reception building hoping for an audience with President Vladimir Putin.
In the end, the Libyan military commander lost patience and stormed out. Hours later, he left Moscow in his Dassault Falcon corporate jet bound for the Jordanian capital, Amman.
When the Russian President invited Libya's rival leaders to sign a truce on Monday (Jan 13), it would appear he had not factored in the legendary stubbornness of the 76-year-old Field Marshal Haftar.
What's more, that he felt emboldened to snub Mr Putin is testament to how unpredictable Libya's civil war has become.
The flash of temper, however, is only the latest confounding twist before a planned Libyan peace conference in Berlin on Sunday.
Just last week, an attempt by former colonial power Italy to broker an encounter between Field Marshal Haftar and Mr Fayez al-Sarraj, prime minister of the United Nations-backed Libyan government, ended with the latter cancelling at the last minute and flying home.
Nothing is playing out as planned, or is what it seems.
Field Marshal Haftar, who is based in eastern Libya, started the latest war in April with an offensive on the capital, Tripoli, to topple Mr Sarraj.
He's now the one throwing up obstacles after his rivals, pressured by their patron Turkey, signed a ceasefire agreement in Moscow.
Field Marshal Haftar said he'd sleep on it, but before the entirety of the slight to Mr Putin became apparent, he was already gone.
"This won't be forgotten by Putin," said Mr Kirill Semyonov, a Libya expert at the Kremlin-founded Russian International Affairs Council.
"Haftar practically ran away when he was expected to sign the document. This showed a lack of respect to his hosts and is a blow to Russia's reputation."
The backdrop to all this is Russia and Turkey's aggressive push into Syria. Relatively minor actors when the Arab protests erupted a decade ago, Moscow and Ankara are staging a dramatic shift in influence in the region.
With the US and Western Europe retreat, they have become key players in a game of geopolitical chess in which they are by turns allies and foes.
The prize of a peace deal could also include the revival of billions of dollars in contracts that were abandoned in the chaos after Muammar Gaddafi's overthrow in 2011.
The setback for the Kremlin came less than a week after Mr Putin moved to take the upper hand in ending the conflict, together with Turkish President Recep Tayyip Erdogan.
Russian officials say they remain cautiously optimistic that Field Marshal Haftar will come back to the table.
The two powers, though, have found themselves stymied by the myriad conflicting interests in Libya, just like Italy, France and other would-be peacemakers.
Western and Arab diplomats who worked on Libya for years said they were not surprised.
Field Marshal Haftar launched his battle for Tripoli during a visit by the UN secretary-general and just before scheduled peace talks.
The question is whether Mr Putin and Mr Erdogan allow him to get away with it.
Field Marshal Haftar started his offensive with the backing of Egypt and the United Arab Emirates, who saw him as an irksome ally but the best bet for a strong leader in the tumultuous North African oil state.
It evolved into a proxy war, with Russia sending mercenaries to fight for Field Marshal Haftar and Turkey supporting Mr Sarraj's Tripoli-based government.
It would only be a matter of time before Mr Putin and Mr Erdogan made a deal to carve out their interests - much as they've done in Syria - then strong-arm their clients into a truce, a Russian official told Bloomberg early this year.
That moment came on Jan 8. After Turkey threatened to step up its backing for Tripoli with a major military deployment, Mr Putin and Mr Erdogan met in Istanbul and called for a ceasefire 72 hours later.
Neither side had bothered beforehand to consult the Libyans, Egypt, the UAE or the UN, which had been working on a ceasefire since April last year, officials familiar with the talks told Bloomberg.
A senior official in the Tripoli-based government hastily boarded a flight to Istanbul to try and understand what had just happened, two officials said.
Mr Putin then reached out by phone to the leaders of Egypt and the UAE, which backs Field Marshal Haftar with its air power.
Egypt and the UAE were not on board with the deal, which they believed gave Turkey too many concessions, an official said.
A Turkish official with knowledge of the Moscow meeting said a ceasefire could enable Turkey and Russia to cooperate in the exploration of oil and gas.
It would also protect a maritime agreement Turkey extracted from the Tripoli-based government in return for military assistance, the person said.
That deal is disputed by Greece and other European countries, who fear Turkish and Russian encroachment into Mediterranean waters.
In all of this, the US appears to have been outmanoeuvred by Russia in yet another Middle East conflict.
Washington had been sending mixed messages to both sides until hundreds of Russian mercenaries arrived in September to the front lines to support Field Marshal Haftar.
Weeks later, they or Libyans manning a missile defence system shot down a US drone, whose wreckage has yet to be retrieved.
The US then began pushing Field Marshal Haftar for a ceasefire and hoping for a peace deal that would squeeze out Russia, several officials with knowledge of their meetings told Bloomberg.
That Field Marshal Haftar baulked in Moscow was down to plans for a Turkish and Russian mission to enforce the truce and a clause in the document that might require him to pull back from areas he controls on the outskirts of Tripoli, a person in Moscow with knowledge of the talks said.
Russia overestimated its ability to influence the Libyan military leader, the person said.
Publicly, Russian officials have put on a brave face.
"Unfortunately, the final document wasn't signed by all parties," Foreign Minister Sergey Lavrov told reporters in India on Wednesday.
"But we never pretended that the talks in Moscow were to be a final meeting that would have resolved all issues without exception," he said, noting that the session helped lay the groundwork for the talks in Berlin.
Mr Erdogan, who has obtained parliamentary approval for a large-scale military intervention, responded to Field Marshal Haftar's walk-out by threatening to teach him a "lesson".
One Turkish official was not ruling out the use of Turkey's F-16 jets.
The Russian Defence Ministry, meanwhile, isn't giving up just yet.
It said Field Marshal Haftar needs more time and suggested it expected him to respond positively ahead of the peace summit scheduled in Berlin, where even more surprises could await.