A federal grand jury in Virginia has indicted former CIA officer John Kiriakou on charges that he violated the Espionage Act by allegedly sharing secret information about some of his colleagues with reporters.

Kiriakou, 47, promised never to divulge classified material when he joined the agency in 1990. But federal prosecutors led by Chicago U.S. Attorney Patrick Fitzgerald used Kiriakou's own email trail with journalists to build a case against him. The government ultimately concluded Kiriakou had shared the name of an officer operating undercover with an unnamed reporter and that he disclosed the name and contact information for another CIA employee who was involved in the capture of al-Qaida member Abu Zubaydah.

The Justice Department started digging around in 2009, after allegations that defense attorneys and investigators working for detainees at Guantanamo Bay, Cuba, had improperly shared photos of undercover CIA officials with the detainees. Those defense lawyers and investigators did nothing wrong, prosecutors say. Instead, their investigation led instead to someone who once operated inside the government's own ranks — Kiriakou.

The five count indictment mostly mirrors an earlier criminal complaint the FBI unsealed before it arrested Kiriakou earlier this year. He's now free on bond, and due back in court for arraignment April 13th.

Prosecutors say he faces 10 years in prison if he's convicted on the espionage charges and five more if he's found guilty of trying to trick a CIA board into allowing him to publish classified information in his book.

Lawyers for Kiriakou had no immediate comment Thursday, but some free speech advocates have called him a whistleblower for publicly discussing the waterboarding of high value terrorism suspects during the years after the September 11, 2001, attacks.

Update at 5:28 p.m. ET. The Sixth Charged:

The Government Accountability Project says Kiriakou is the sixth whistleblower to be charged by the Obama administration using the Espionage Act.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.