The agreement, signed by Russia, Armenia and Azerbaijan, follows six weeks of heavy fighting and advances by Azeri forces. On Sunday, Azerbaijan proclaimed victory in the enclave's second-largest city.
"The brotherly Azerbaijan has achieved an important gain on the battleground and table. I sincerely congratulate this sacred success," Turkey's Foreign Minister Mevlut Cavusoglu said on Twitter. "We will continue to be one nation, one spirit with our Azeri brothers."
Turkey had accused Armenia of occupying Azeri lands and vowed full solidarity with Azerbaijan, with which it has close ethnic Turkic ties.
Under the deal, Russian peacekeepers will be deployed along the frontline in Nagorno-Karabakh and the corridor between the region and Armenia. Azeri President Ilham Aliyev said Turkey will also take part in the peace keeping process.
Azerbaijan says it has since Sept. 27 retaken much of the land in and around the Nagorno-Karabakh enclave that it lost in a 1991-94 war which killed an estimated 30,000 people and forced many more from their homes. Armenia has denied the extent of Azerbaijan's territorial gains.Several thousand people are feared to have been killed in the flare-up of the conflict. Three ceasefires had failed before the declaration early on Tuesday.