Updated

A former sailor from Virginia has been sentenced to 30 years in prison for attempted espionage.

Virginia Beach resident Robert Hoffman faced the possibility of life in prison for trying to pass secrets to people he believed worked for the Russian government. They were FBI agents.

Hoffman was sentenced in federal court in Norfolk on Monday by U.S. District Judge Robert Doumar.

Prosecutors say Hoffman gave classified information about tracking ships to people he believed were Russian spies.

Hoffman was a cryptologic technician in the Navy who held top secret clearance and retired in November 2011. Hoffman spent much of his 20-year Navy career on submarines.

Hoffman, originally from Buffalo, N.Y., retired with the rank of petty officer first class.