ATHENS (Reuters) - Greek Prime Minister Alexis Tsipras said on Tuesday the release of two Greek soldiers in custody by Turkey was an ‘act of justice’ which would help foster closer relations between the two neighbors frequently at odds.

A Turkish court released two Greek soldiers pending their trial on espionage charges, state-run news agency Anadolu said on Tuesday, in a case that has fueled tensions between the two neighboring NATO allies.

Greece has said the soldiers crossed into Turkey by mistake while following the trail of suspected illegal migrants. Turkish courts ordered their detention in March on suspicion of illegal entry and attempted military espionage.

“The release of the two Greek officers is an act of justice which will contribute to friendship, good neighborly relations and stability in the region,” a statement from Tsipras’s office said.