KYIV, Ukraine (AP) — Ukraine announced a high-profile prisoner swap early Thursday that was the culmination of months of efforts to free many of the Ukrainian fighters who defended a steel plant in Mariupol during a long Russian siege. In exchange, Ukraine gave up a prominent ally of Russian President Vladimir Putin and 55 other prisoners.

President Volodymr Zelenskyy said his government had won freedom from Russian custody for 215 Ukrainian and foreign citizens, with the help of Turkish and Saudi mediation efforts. He said many were soldiers and officers who had faced the death penalty in Russian-occupied territory.

Russian officials didn’t immediately confirm or otherwise comment on what appeared to be the biggest prisoner swap during the nearly seven-month war.

Of the total, 200 Ukrainians were exchanged for just one man — pro-Russian opposition leader Viktor Medvedchuk, who is Ukrainian. The 68-year-old oligarch escaped from house arrest in Ukraine several days before Russia’s invasion Feb. 24 but was recaptured in April. He faced up to life in prison on charges of treason and aiding and abetting a terrorist organization for mediating coal purchases for the separatist, Russia-backed Donetsk republic in eastern Ukraine.

Medvedchuk came to know Putin while serving as chief of staff for former Ukrainian President Leonid Kuchma. The Russian leader is the godfather of Medvedchuk’s daughter. His detention sparked a heated exchange between officials in Moscow and Kyiv.

Medvedchuk is the head of the political council of Ukraine’s pro-Russian Opposition Platform-For Life party, the largest opposition group in Ukraine’s parliament. The Ukrainian government has suspended the party’s activity; Putin has repeatedly spoken about Medvedchuk as a victim of political repression.

“It is not a pity to give up Medvedchuk for real warriors,” Zelenskyy said in his nightly video speech. “He has passed all the investigative actions provided by law. Ukraine has received from him everything necessary to establish the truth in the framework of criminal proceedings.”

In another swap, Ukraine gained the release of five commanders who led Ukraine’s defense of the Azovstal steel plant in Mariupol in exchange for 55 Russian prisoners it was holding, Zelenskyy said.

More than 2,000 defenders, many in the Azov Regiment, marched out of the Azovstal steel plant’s twisted wreckage into Russian captivity in mid-May, ending a nearly three-month siege of the port city of Mariupol.

Zelenskyy said the five leaders, including Azov Regiment commanders Denys Prokopenko and Svyatoslav Palamar, are in Turkey, where they will remain as part of the deal “in complete safety” until the end of the war, under the protection of Turkish President Recep Tayyip Erdogan.

The complex prisoner swap also brought the release of 10 foreigners, including five British nationals and two U.S. military veterans, who had fought with Ukrainian forces. They were released by Russian-backed separatists as part of an exchange mediated by Saudi Arabia, U.S. and Saudi officials said.

A video on the BBC news website Thursday showed two of the released British men, Aiden Aslin and Shaun Pinner, speaking inside a plane.

“We just want to let everyone know that we’re now out of the danger zone and we’re on our way home to our families,” Aslin said in the video, as Pinner added: “By the skin of our teeth.”

The BBC reported that the two men, along with a third British detainee, John Harding, have arrived in Riyadh, Saudi Arabia. It said they appeared to be accompanied by a group of Saudi officials.

U.N. Secretary-General Antonio Guterres welcomed the exchanges, calling them “no small feat,” but adding that “much more remains to be done to ease the suffering caused by the war in Ukraine,” his spokesman said. The U.N. chief reiterates the need to respect international law on the treatment of prisoners and will continue to support further prisoner exchanges, spokesman Stephane Dujarric said.

The exchanges drew angry comments from some nationalist commentators in Russia. Igor Strelkov, a Russian officer who led the Moscow-backed separatists in the Donbas when a conflict there erupted in 2014, described the swap as an act of treason, saying that “it’s worse than a crime, worsen than a mistake, it’s just sheer stupidity or sabotage.”

___ Associated Press writer Sylvia Hui in London contributed to this report.