He was also put on three and a half years of police probation, with about nine months Stilve spent in custody factored into the sentence.
Stilve pleaded guilty and expressed remorse over his actions.
As reported, Latvia's counter-espionage Security Police announced January 26 that late in December 2017 they had arrested a suspected spy, a Latvia citizen believed to have been passing information to a foreign power.
Later on the Security Police said that a Latvian citizen had worked for Russian security services, collecting and handing down information about the infrastructure of National Armed Forces, as well as other objects of interest to Russia.
It was also discovered during the investigation that the Latvian citizen had cooperated with an officer of the Russian security forces on Russian soil.
Earlier on the Re:Baltica centre for investigative journalism reported that the accused is a farm owner who lives the Alūksne region near the border with Estonia and Russia.
He was accused of collecting open-source information on what has been happening near the Latvian-Russian border at the request of Russian authorities.