Turkey's president has apologised to Moscow for the downing of a Russian military jet on the Syrian border, a move that could ease bitter tensions between the two countries.
Recep Tayyip Erdogan's move came seven months after the incident, which drew a slew of Russian sanctions that have dealt a severe blow to the Turkish economy.
The formal apology, which the Kremlin had requested, will likely allow relations to improve.
Mr Erdogan, in his message, expressed "sympathy and deep condolences" to the family of the killed pilot and apologised, Russian President Vladimir Putin's spokesman Dmitry Peskov told reporters.
Mr Erdogan's spokesman Ibrahim Kalin said the Turkish leader expressed his deep regret over the downing of the Russian plane: "In the letter, the president stated that he would like to inform the family of the deceased Russian pilot that I share their pain and to offer my condolences to them. May they excuse us."
Mr Putin denounced the downing of the plane on November 24 as a "treacherous stab in the back". Russia rejected the Turkish claim that the plane had violated its airspace, and responded by deploying long-range air defence missiles to its base in Syria, warning they would destroy any target posing a threat to Russian aircraft.
Moscow also moved swiftly to ban the sales of package tours to Turkey, which had depended heavily on the Russian tourist flow; banned most of Turkey's food exports; and introduced restrictions against Turkish construction companies which had won a sizeable niche of the Russian market.
Before the plane was downed, Russia had been the largest destination for Turkish exports, mostly textile and food, and also the biggest source of Turkish imports.
The incident reflected simmering tensions between Russia and Turkey, which had backed opposing sides in the Syrian conflict. Russia's air campaign, which began in September, helped shore up Syrian president Bashar Assad, whose foes have been backed by Turkey.
Lifting the crippling restrictions was essential for Mr Erdogan, who has found himself under pressure both at home and abroad.
Since the incident, Mr Erdogan and his ministers have continuously spoken in favour of normalising ties with Moscow, but Mr Putin made it clear that he expected a formal apology and compensation.
Mr Erdogan has now offered both, according to his letter, the excerpts of which were released by the Kremlin.
"I would like to express my compassion and deep condolences to the family of the dead Russian pilot and I say I'm sorry," the Kremlin statement quoted his letter as saying.
"I share their pain with all my heart. We are ready to take any incentive to help ease the pain and the burden of inflicted damage."
Mr Erdogan's office also said that the Turkish leader called on Mr Putin to restore the traditional friendly relations between Turkey and Russia and work together to address regional crises and jointly combat terrorism.
"We are pleased to announce that Turkey and Russia have agreed to take necessary steps without delay to improve bilateral relations," Mr Kalin said.
The Kremlin said the letter added that the Turkish authorities are conducting a probe against a Turkish citizen, who allegedly shot and killed the plane's pilot as he was descending by parachute. The plane's co-pilot survived and was rescued, but a Russian marine was killed by militants during the rescue mission near the border.