Alexander Krasnopyorov, a staffer with the Latvian Railways, is suspected of having tracked and photographed NATO transport moving through the Baltic nation in 2015 and 2016.
"The court has freed Alexander. He was released on Friday. He has signed papers agreeing not to leave the country," Vladimir Linderman, the suspect's legal counsel, said.
A court in the Latvian city of Jelgava, southwest of the country’s capital Riga, has been trying the alleged espionage case since June. Krasnopyorov may face a prison term of up to ten years if found guilty.