MAXIM ZMEYEV / Reuters Ukrainian military pilot Nadezhda Savchenko looks out from a defendants' cage as she attends a court hearing in Moscow March 4, 2015.

Ukrainian military pilot Nadiya Savchenko arrived home in Kiev on Wednesday after nearly two years in a Russian jail, part of a prisoner swap in which two Russians held in Ukraine were returned to Moscow.

Handing over Savchenko, whose release had been demanded by Western governments and who has become a national hero in Ukraine, is likely to ease tensions between Moscow and the West a few weeks before the European Union decides whether to extend sanctions against Russia.

"A presidential plane with Ukraine's hero Nadiya Savchenko has landed," Ukrainian President Petro Poroshenko said in a post on Twitter.

In Moscow, Kremlin spokesman Dmitry Peskov said that Savchenko, who while in Russian jail was elected a member of the Ukrainian parliament, was granted a pardon by Russian President Vladimir Putin to allow her to leave jail and return home.

Peskov also said that the two Russians, Alexander Alexandrov and Yevgeny Yerofeyev, were now back in Russia, having landed at Moscow's Vnukovo airport on a special flight from Kiev.

Ukraine accused them of being Russian special forces officers fighting in eastern Ukraine, though Moscow has never acknowledged the two were following its orders.

SYMBOL OF RESISTANCE

Savchenko, a military pilot, volunteered to fight with a ground unit against pro-Moscow separatists who rose up against Kiev's rule in eastern Ukraine.

She was captured and put on trial in southern Russia, charged with complicity in the deaths of Russian journalists who were killed by artillery while covering the conflict. She was accused of acting as a spotter, calling down the fire that killed the journalists, but denied the accusation.

A Russian court in March sentenced her to 22 years in jail. She is widely seen in Ukraine as a symbol of resistance against Russia, a perception bolstered by her defiant behavior in court during her trial.

At one point, she interrupted the judge reading out his verdict by standing on a bench and singing the Ukrainian anthem at the top of her voice.

Yerofeyev and Alexandrov both told Reuters in interviews last year they were Russian special forces soldiers who were captured while carrying out a secret operation in eastern Ukraine.

Alexandrov's mother, Zinaida, told Reuters by telephone on Wednesday: "I'm glad, I'm very happy. I hope that everything will be okay for him, I really want to see him."

Russia's relations with its neighbor Ukraine have been toxic since an uprising in 2014 forced out the Moscow-backed Ukrainian leader Viktor Yanukovich and installed a pro-Western administration.

Russia then annexed Ukraine's Crimea Peninsula. Moscow said it was protecting the local Russian-speaking population from persecution by the new authorities in Kiev, but Western governments called it an illegal land-grab and imposed sanctions on Moscow.

Soon after, pro-Moscow separatists began an armed separatist rebellion in the Donbass region of eastern Ukraine, an area with a large-Russian speaking community. Fighting between the rebels and Ukraine's forces killed thousands of people.

A fragile ceasefire has been in place since last year, but there is no permanent settlement to the conflict.

(Additional reporting by Dmitry Solovyov; Writing by Christian Lowe; Editing by Ralph Boulton)