STORY: The freed prisoners include the commander and deputy commander of the Azov battalion that did much of the fighting, said Andriy Yermak, the head of President Volodymyr Zelenskiy's office.
The move is unexpected, since Russian-backed separatists last month said there would be a trial of Azov personnel, who Moscow describes as Nazis.
Ukraine denies the charge.
In a statement, Yermak said the freed prisoners included Azov commander Lieutenant Colonel Denys Prokopenko and his deputy, Svyatoslav Palamar.
Also at liberty is Serhiy Volynsky, the commander of the 36th Marine Brigade of the Ukrainian Armed Forces.
The three men had helped lead a dogged weeks-long resistance from the bunkers and tunnels below Mariupol's giant steel works before they and hundreds of Azov fighters surrendered in May to Russian-backed forces.
Yermak said that in return, Kyiv had freed 55 Russian prisoners as well as Viktor Medvedchuk, the leader of a banned pro-Russian party who was facing treason charges.
Last month, the head of the Russian-backed separatist administration in the eastern Ukrainian region of Donetsk said a trial of captured Azov personnel would take place by the end of the summer.
The Azov unit, formed in 2014 as a militia to fight Russian-backed separatists, denies being fascist, and Ukraine says it has been reformed from its radical nationalist origins.