Turkey and Russia have agreed to monitor a truce over the disputed Nagorno-Karabakh region from a joint peacekeeping centre, Ankara's defence ministry said on Tuesday.
The deal comes after days of talks between Turkish and Russian officials about how the two regional powers would jointly implement a Moscow-brokered ceasefire signed this month between Armenia and Azerbaijan.
Technical details for setting up the joint centre were concluded and an agreement was signed, the defence ministry said in a statement, adding that it would begin work "as soon as possible."
Turkey is a staunch ally of Azerbaijan and has fervently defended its right to take back the Nagorno-Karabakh lands Baku lost to ethnic Armenian separatists in a 1988-94 war.
The truce deal ended more than six weeks of fighting that claimed more than 1,400 lives and saw ethnic Armenians agree to withdraw from large parts of the contested region of Azerbaijan.
The Turkish parliament voted this month to deploy a mission to "establish a joint centre with Russia and to carry out the centre's activities".
The deployment is set to last a year and its size will be determined by President Recep Tayyip Erdogan.
Russia has said repeatedly that Turkey will have no troops on the ground under the truce deal's terms.
Azerbaijani forces raise flag in last district
Azerbaijani soldiers on Tuesday hoisted their country's flag in the final district given up by Armenia under a peace deal that ended weeks of fighting over the disputed Nagorno-Karabakh region.
A column of Azerbaijani military trucks entered the Lachin district overnight, taking over the last of three regions around Karabakh handed over by Armenia under the Russian-brokered agreement.
AFP journalists saw soldiers raising the Azerbaijani flag over an administrative building in the town of Lachin in the early hours.
Armenia agreed to hand over the three districts -- Aghdam, Lachin and Kalbajar -- as part of the November deal that stopped an Azerbaijani offensive that had reclaimed swathes of territory lost to Armenian separatists in a 1990s war.
Under the agreement, some 2,000 Russian peacekeepers deployed between the two sides and along the Lachin corridor, a 60-kilometre (35-mile) route through the district that connects Karabakh's main city Stepanakert to Armenia.
Russian military vehicles accompanied Azerbaijani trucks driving along the corridor overnight and were deployed at the main crossroads in Lachin.
Most of the town's residents fled in advance of the takeover, but 48-year-old Levon Gevorgyan, the owner of a local grocery store, said he had decided to stay.
"I am afraid only of God. I have been here for 22 years, I started from nothing, I built everything," he said. "I hope I will be able to continue, I still have a loan to pay. If I have to leave, I will burn everything."
- 'Nowhere to go' -
As in Aghdam and Kalbajar, residents of Lachin cleared out frantically ahead of the handover, taking livestock, firewood, furniture and even plastic water pipes.
Nagorno-Karabakh broke from Azerbaijan's control in a war after the 1991 collapse of the Soviet Union that left some 30,000 people dead.
The region declared independence but it was never recognised by any country, including Armenia which strongly backs the separatists.
The peace accord signed on November 9 was reached after six weeks of fighting that saw Azerbaijan's army overwhelm separatists forces and threaten to advance on Stepanakert.
Under the agreement, Armenia is losing control of seven districts that it seized around Karabakh in the 1990s -- many Azerbaijanis who were forced to flee are now planning to return.
The separatists are retaining control over most of Karabakh's Soviet-era territory but have lost the key town of Shusha.
Lachin official Davit Davtyan said residents of the district had been given until 6:00 pm on Monday to leave, except for some 200 locals allowed to stay to maintain infrastructure along the corridor.
"Residents who were not able to leave because they had nowhere to go said they would stay and see what happens on Tuesday," he said.
In the village of Aghavno along the Lachin corridor, 60-year-old Araksya Gyokchakyan watched residents load furniture and firewood into cars and trucks even as she was set on remaining behind.
"I don't know where to go. I stayed here during the war. It's my home," she told AFP.
As well as deploying peacekeepers, Russia is helping some of the tens of thousands who fled the fighting to return to Karabakh itself.
Moscow's defence ministry said on Tuesday it had so far assisted in the return of more than 26,000 people.
It said its peacekeepers had also cleared mines along the Lachin corridor and helped restore a power line destroyed during the fighting.
- Russia's role grows -
Moscow's peacemaker role has overshadowed France and the United States -- the three countries that form the Minsk Group, which led talks on the Karabakh conflict for decades but failed to achieve a lasting agreement.
France's position in future negotiations may be further under threat after Azerbaijani lawmakers last week demanded the country be expelled from the Minsk Group.
The move came after the French Senate adopted a non-binding resolution calling on France to recognise Karabakh as an independent state.
While Azerbaijan has also called for its staunch ally Turkey to play a role in the peacekeeping mission, Moscow insists Ankara will not be involved.
Azerbaijan's defence ministry on Monday said that Turkish military specialists were providing assistance in clearing mines from the districts Baku had retaken.
In Yerevan on Monday demonstrators rallied outside the French embassy appealing for help in finding soldiers still missing after the fighting.
While Armenia has reported more than 2,300 military casualties, thought to be an underestimate, Azerbaijan has not disclosed any military losses.
More than 100 civilians were reported killed on both sides.