A former CIA officer pleaded guilty Tuesday to leaking the identity of one of the agency's covert operatives to a reporter.

As part of a plea deal, prosecutors dropped charges against John Kiriakou, 48, that had been filed under the first world war-era Espionage Act. They also dropped a count of making false statements. Kiriakou's supporters argue that he is a whistleblower on issues including torture and the CIA's rendition program. All sides agreed to a prison term of two years.

US district judge Leonie Brinkema noted that the term was identical to that which was imposed on Scooter Libby, the chief of staff to former Vice President Dick Cheney, in 2007. Libby was convicted in a case in which he was accused of leaking information that compromised the covert identity of the CIA operative Valerie Plame, though Libby's sentence was commuted by then-president George W Bush.

Kiriakou, who wrote a book detailing his CIA career, initially tried to argue that he was a victim of vindictive prosecution by government officials who believed he had portrayed the CIA negatively. The judge rejected those arguments.

Kiriakou was a CIA veteran who played a role in the agency's capture of the al-Qaida terrorist Abu Zubaydah in Pakistan in 2002. Abu Zubaydah was waterboarded by government interrogators and eventually revealed information that led to the arrest of the "dirty bomb" plotter Jose Padilla and exposed Khalid Sheikh Mohamed as the mastermind of the 9/11 terror attacks. Accounts conflict over whether the waterboarding was helpful in getting intelligence from Zubaydah.

Kiriakou, who did not participate in the waterboarding, expressed ambivalence in news media interviews about the practice but ultimately declared that it was torture.

After Tuesday's hearing, one of Kiriakou's lawyers, Jesselyn Radack, an expert on whistleblower issues with the Government Accountability Project, said it was an outrage that Kiriakou would serve jail time. She said she was glad, though, that the charges under the Espionage Act had been dropped.

Radack said Kiriakou had been motivated to take the plea by the fact that he has five children and wanted to ensure he would be out of prison in time to see them grow up.

Radack said Kiriakou deserved to be considered a whistleblower because the name he revealed to a journalist was an individual involved in the CIA's rendition program, which Radack said engaged in torture. She also said Kiriakou became a strong voice against waterboarding and other torture tactics.

Prosecutors dispute the notion that Kiriakou was any kind of whistleblower. In court papers, they said the investigation of Kiriakou began in 2009 when authorities became alarmed after discovering that detainees at Guantanamo Bay possessed photographs of CIA and FBI personnel who had interrogated them. The investigation eventually led back to Kiriakou, according to a government affidavit.

The papers indicated that prosecutors believed Kiriakou had leaked the name of a CIA covert operative to a journalist, who disclosed it to an investigator working for the lawyer of a Guantanamo detainee.

Neil MacBride, US attorney for the Eastern District of Virginia, said: "The government has a vital interest in protecting the identities of those involved in covert operations. Leaks of highly sensitive, closely held and classified information compromise national security and can put individual lives in danger."

The CIA director, David Petraeus, sent a memo to agency employees noting Kiriakou's conviction, saying: "It marks an important victory for our agency, for our intelligence community, and for our country. Oaths do matter, and there are indeed consequences for those who believe they are above the laws that protect our fellow officers and enable American intelligence agencies to operate with the requisite degree of secrecy."

Kiriakou had planned to subpoena three journalists connected to the case. Those journalists had filed motions to quash the subpoenas, but that issue is now moot.

Kiriakou will be formally sentenced in January.