The soldiers were flown from Baku to Yerevan by a Russian military transport plane. They were immediately taken to a military hospital in the Armenian capital for a medical checkup.
Dozens of other Armenian soldiers remain in Azerbaijani captivity. Most of them were taken prisoner in Nagorno-Karabakh shortly after last year’s Armenian-Azerbaijani war.
Many of these POWs were given lengthy prison sentences earlier this year in trials condemned by the Armenian government. Armenia regularly demands their unconditional release, saying that they are held in breach of a Russian-brokered agreement that stopped the six-week war.
Azerbaijan says the agreement does not cover them because they were captured after the ceasefire took effect in November.
Baku freed this summer 30 Armenian POWs in exchange for maps of Armenian minefields in districts around Karabakh that were retaken by Azerbaijani forces during and after the war. Azerbaijani President Ilham Aliyev claimed early this month that those maps are not accurate and said Yerevan should provide more detailed information.
Shortly afterwards Prime Minister Nikol Pashinian signaled his readiness to give Baku more such maps to secure the release of more Armenian prisoners.
It was not immediately clear if the release of the five Armenian soldiers was the result of such an exchange. They returned home ahead of a fresh round of Russian-mediated talks in Moscow on the reopening of transport links between Armenia and Azerbaijan envisaged by the Karabakh truce accord.