The ex-Soviet country was roiled by clashes sparked during peaceful rallies around the New Year against fuel price hikes. At least 225 people -- including 19 servicemen -- died in unrest that prompted President Kassym-Jomart Tokayev to appeal to Moscow for help.
The crisis has spurred suggestions of a rift between Tokayev and his long-ruling predecessor Nursultan Nazarbayev, 81, who spoke for the first time since the protests Tuesday and denied any conflict with the president.
The Russian defence ministry said Wednesday that four planes carrying its remaining troops had departed from the capital Nur-Sultan and Kazakhstan's largest city Almaty.
"The last of the peacekeepers and the command of the Russian peacekeeping contingent headed by Colonel General Andrei Serdyukov will return home on these planes," it said.
Video distributed by the ministry showed troops landing at an airport in the southern Russian city of Ulyanovsk, where a ceremony was held to mark their return.
Troops from the alliance of ex-Soviet states including Armenia, Belarus, Tajikistan, Kyrgyzstan, Kazakhstan and Russia began arriving January 6 after the urgent plea from Tokayev, and started their withdrawal last week.
Their last departure came hours after Tokayev's spokesman Berik Uali confirmed the end of a two-week state of emergency, saying "the unity and integrity of the people, law enforcement agencies and military" had ensured order was restored.
"May there be peace and goodness in our country always!" Uali wrote on Facebook.
But Almaty was tense Wednesday morning, where AFP correspondents saw police blocking access to several central roads after a banned opposition group called for protests.
The decision to despatch peacekeepers was a first for the Collective Security Treaty Organisation (CSTO), often touted by Russia as a NATO equivalent.
There had been concerns Moscow would leverage the mission to influence Kazakhstan and US Secretary of State Antony Blinken had warned that "once Russians are in your house, it's sometimes very difficult to get them to leave".