Two Greek servicemen who had been detained in Turkey since early March for accidentally crossing the border in bad weather have been released from jail pending trial, Anadolu agency reported on Tuesday evening.

According to Anadolu, a court examined the request for their release and ruled there are no reasons to keep them behind bars.

The ruling does not mention any measures restricting their movement which means the soldiers can return to Greece.

Lieutenant Angelos Mitretodis and Sergeant Dimitris Kouklatzis had been held in a high security prison in Edirne for 167 days. It is not clear what charges they are facing.

Prime Minister Alexis Tsipras said in a tweet the release of the servicemen “is an act of justice which will contribute in boosting friendship, good neighborly relations and stability in the region.”

“I would like to congratulate and thank our two officers and their families for their courage, patience and confidence in our efforts, which were ultimately vindicated,” he added.

On Monday, Greece’s top military announced it was suspending some confidence-building activities with Turkey for the remainder of the year, as a response to the prolonged detention.

The measures under suspension extend to the the exchange of military academy graduates as well as sporting and cultural activities, which have already been scaled down over the detention of the two soldiers, who were arrested after accidentally crossing a borderline between the two countries.