Azerbaijan released 32 Armenian servicemen on December 7, while Armenia released two Azerbaijanis, according to a joint statement from the two countries that outlined other "tangible steps" toward building trust.
The statement from the office of Armenian Nikol Pashinian and the administration of the president of Azerbaijan, Ilham Aliyev, said both sides viewed the prisoner release as “guided by humanitarian values, and as a manifestation of goodwill."
The names of the released servicemen have not yet been released.
The statement also said there is a historic opportunity to achieve long-awaited peace.
"The two states reaffirm their intention to regulate relations and reach a peace treaty based on respect for the principles of sovereignty and territorial integrity," the statement said.
European Council President Charles Michel hailed the agreement as a "major break through" in Armenian and Azerbaijani relations.
"Welcome in particular release of detainees and unprecedented opening in political dialogue," Michel said on X, formerly Twitter. "Establishing and deepening bilateral dialogue between sides has been a key objective of the EU-led Brussels process: today’s progress is a key step."
He encouraged the leaders to finalize a peace deal as soon as possible.
In another goodwill gesture, Armenia expressed its support for Azerbaijan's bid to host next year's Session of the Conference of the Parties to the United Nations Framework Convention on Climate Change (COP29) and is withdrawing its own candidacy.
The two countries hope that other states of the convention's Eastern European Group will also support Azerbaijan's bid to host the event.
Azerbaijan in turn expressed its support for Armenia's candidacy for membership in the COP Bureau of the Eastern European Group.
Armenia and Azerbaijan will continue their discussions on the implementation of more confidence-building measures, the statement said. They also call on the international community to support their efforts, which they said will contribute to building mutual trust between the two states and have a positive impact on the entire South Caucasus.
Azerbaijan and Armenian have been taking preliminary steps toward a formal peace agreement since Baku regained control over the breakaway region of Nagorno-Karabakh in September, resulting in an exodus of ethnic Armenians from the region.
Negotiators from the two countries last week led a meeting of their nations' border delimitation commissions and agreed to intensify future talks on the matter, which has been another focus of preliminary discussions.