A 32-year-old former German spy has been convicted of violating the country's official secrets law and sentenced to eight years in prison for providing classified information to the CIA and the Russians.

The dpa news agency reported Thursday that Markus R., whose last name wasn't given in line with privacy laws, was found by the Munich state court to have sold some 200 highly classified documents to the CIA between 2008 and 2014 for 80,000 euros ($91,000). Among other things, he provided a list of German agents working abroad, giving both their names and cover identities.

He confessed during his trial, saying he acted out of frustration and boredom.

In 2014, before his arrest, he also passed three "highly important" documents to the Russians but then broke off contact himself.