Azerbaijan's Karabakh region came under Baku's full control after Russia shut down a 2,000-strong military base Wednesday.
Azerbaijani forces recaptured the area last year despite a two-year Russian mission to prevent war between Azerbaijan and Armenia.
A total of 1,960 Russian peacekeepers had been housed in 10 barracks at the base in Khojaly, a town in the Karabakh region.
Despite the deployment, Azerbaijan recaptured Karabakh in a lightning offensive last September. Soon after, nearly 100,000 ethnic Armenians, who had occupied the break-away since the 1990s, left for the mainland.
"The presence of Russian peacekeepers made it possible to establish peace on Azerbaijani soil," Russian Col. Gen. Yevgeny Nikiforov said at the departure ceremony.
Azerbaijan's chief of the general staff, Col. Gen. Kerim Valiyev, said Russia had made "every effort to establish peace in the Karabakh economic region" and bring decades of conflict to an end.
Armenia, however, has a very different take on Russia's role. It has accused Moscow of failing Yerevan by doing nothing to prevent Azerbaijan from retaking Karabakh.
Armenia has since suspended its participation in the Collective Security Treaty Organization, a former Soviet states' defense group dominated by Russia.
Armenia was not represented at Wednesday's ceremony, where folk dances and patriotic songs were performed and Russian troops departed to the strains of a military band.
Nikiforov said the Russian force could take credit for providing humanitarian assistance, clearing more than 30,000 explosive devices, returning more than 110 prisoners of war and arranging the return of more than 1,900 fallen soldiers to the respective sides.
"The Russian military completed the task assigned to them," he said.