Two Greek soldiers arrested by Turkish authorities in the northwestern province of Edirne on March 1 on charges of illegal border crossing and attempted espionage were released pending trial late Tuesday.

Greek Lt. Aggelos Mitretodis and noncommissioned officer Dimitros Kouklatzis were detained after being discovered by patrolling Turkish troops near the Pazarkule border gate, five kilometers from Edirne province, near the Greek border.

The two men, who are charged with military espionage and entering a forbidden military zone, repeated their earlier defense and said they crossed into the Turkish side of the border by mistake.

The prosecution said the pair testified they entered the Turkish side by tracking footsteps in the snow and filmed images on their mobile phones to send to higher ranking officials.

The soldiers flew back from Turkey on a Greek government plane after being released from prison late Tuesday.

Greek authorities said Wednesday that two Greek soldiers have been released from hospital following medical checks and are returning to their families.

The two were given a clean bill of health from a military hospital in northern Greece, a Greek military official said. The official spoke on condition of anonymity because he was not authorized to release details.

Greek Prime Minister Alexis Tsipras immediately welcomed the move as an "act of justice." Their release will "contribute to a reinforcement of friendship, good neighborliness and stability in the region," he said in a statement.

Greek Defense Minister Panos Kammenos, who is known for his hostile statements toward Turkey, invited his Turkish counterpart Hulusi Akar Wednesday to visit Greece following the release of the two Greek soldiers.

"Defense Minister Panos Kammenos spoke with Turkey's Defense Minister Hulusi Akar over the phone. He expressed his appreciation over the release of the two Greek soldiers and invited him [Akar] for an official visit to Greece," Greek officials said in a statement.

European Commission President Jean-Claude Juncker also welcomed Turkey's decision.

"Delighted by the news of the imminent release of the 2 Greek soldiers detained in Turkey," he said on his Twitter account. "As I said in Varna, Turkey has nothing to fear from its European neighbors. The EU will remain engaged in this strategic partnership. We want to see a democratic, stable & prosperous Turkey," he added.

In late March, a Turkey-EU summit was held under the leadership of President Recep Tayyip Erdoğan, European Council President Donald Tusk and Juncker in Varna, Bulgaria. During the summit, matters such as Turkey-EU relations were discussed.

The strained Greece-Turkey ties are not new, though there had been attempts from both sides to normalize relations. The main issues have historically been related to the Cyprus and the situation of islands in the Aegean. The Greek Cypriot administration's unilateral steps on natural gas exploration drilling in the Mediterranean the disagreements over Kardak islets have rekindled tensions in the two-decade issue stemming from the larger territorial waters dispute in the Aegean.

Athens' tolerance to putschist soldiers that participated in the 2016 coup attempt by the Gülenist Terror Group (FETÖ) has also, indeed, added to the already shaky relations. Turkey has repeatedly called for the extradition of the suspected coup-plotters, including during President Erdoğan's official visit to Greece last December. However, no steps have yet been taken by Athens to address Ankara's demands.

The release order for the two men comes as Turkey and its NATO ally the United States have been locked in a heated crisis emanating from unjust sanctions and the actions of U.S. President Donald Trump, as Washington levied sanctions on Interior Minister Süleyman Soylu and Justice Minister Abdulhamit Gül for not releasing American pastor Andrew Brunson, who faces terrorism charges in Turkey.