In his years as a C.I.A. operative, after all, Mr. Kiriakou had worked closely with F.B.I. agents overseas. Just months earlier, he had reported to the bureau a recruiting attempt by someone he believed to be an Asian spy.
"Anything for the F.B.I.," Mr. Kiriakou replied.
Only an hour into what began as a relaxed chat with the two agents - the younger one who traded Pittsburgh Steelers talk with him and the senior investigator with the droopy eye - did he begin to realize just who was the target of their investigation.
Finally, the older agent leaned in close and said, by Mr. Kiriakou's recollection, "In the interest of full disclosure, I should tell you that right now we're executing a search warrant at your house and seizing your electronic devices."
On Jan. 25, Mr. Kiriakou is scheduled to be sentenced to 30 months in prison as part of a plea deal in which he admitted violating the Intelligence Identities Protection Act by e-mailing the name of a covert C.I.A. officer to a freelance reporter, who did not publish it. The law was passed in 1982, aimed at radical publications that deliberately sought to out undercover agents, exposing their secret work and endangering their lives.
In more than six decades of fraught interaction between the agency and the news media, John Kiriakou is the first current or former C.I.A. officer to be convicted of disclosing classified information to a reporter.
Mr. Kiriakou, 48, earned numerous commendations in nearly 15 years at the C.I.A., some of which were spent undercover overseas chasing Al Qaeda and other terrorist groups. He led the team in 2002 that found Abu Zubaydah, a terrorist logistics specialist for Al Qaeda, and other militants whose capture in Pakistan was hailed as a notable victory after the Sept. 11 attacks.
He got mixed reviews at the agency, which he left in 2004 for a consulting job. Some praised his skills, first as an analyst and then as an overseas operative; others considered him a loose cannon.
Mr. Kiriakou first stumbled into the public limelight by speaking out about waterboarding on television in 2007, quickly becoming a source for national security journalists, including this reporter, who turned up in Mr. Kiriakou's indictment last year as Journalist B. When he gave the covert officer's name to the freelancer, he said, he was simply trying to help a writer find a potential source and had no intention or expectation that the name would ever become public. In fact, it did not surface publicly until long after Mr. Kiriakou was charged.
He is remorseful, up to a point. "I should never have provided the name," he said on Friday in the latest of a series of interviews. "I regret doing it, and I never will do it again."
At the same time, he argues, with the backing of some former agency colleagues, that the case - one of an unprecedented string of six prosecutions under President Obama for leaking information to the news media - was unfair and ill-advised as public policy.
His supporters are an unlikely collection of old friends, former spies, left-leaning critics of the government and conservative Christian opponents of torture. Oliver Stone sent a message of encouragement, as did several professors at Liberty University, where Mr. Kiriakou has taught. They view the case as an outrage against a man who risked his life to defend the country.
Whatever his loquaciousness with journalists, they say, he neither intended to damage national security nor did so. Some see a particular injustice in the impending imprisonment of Mr. Kiriakou, who in his first 2007 appearance on ABC News defended the agency's resort to desperate measures but also said that he had come to believe that waterboarding was torture and should no longer be used in American interrogations.
Bruce Riedel, a retired veteran C.I.A. officer who led an Afghan war review for Mr. Obama and turned down an offer to be considered for C.I.A. director in 2009, said Mr. Kiriakou, who worked for him in the 1990s, was "an exceptionally good intelligence officer" who did not deserve to go to prison.
"To me, the irony of this whole thing is, very simply, that he's going to be the only C.I.A. officer to go to jail over torture," even though he publicly denounced torture, Mr. Riedel said. "It's deeply ironic under the Democratic president who ended torture."
Comment: The above is certainly ironic, but it should be noted that Obama has NOT ended torture.
John A. Rizzo, a senior C.I.A. lawyer for three decades, said that he did not believe Mr. Kiriakou set out to harm national security or endanger anyone, but that his violation was serious.
"I think he wanted to be a big shot," Mr. Rizzo said. "I don't think he was evil. But it's not a trivial thing to reveal a name."
The leak prosecutions have been lauded on Capitol Hill as a long-overdue response to a rash of dangerous disclosures and have been defended by both Mr. Obama and his attorney general, Eric H. Holder Jr. But their aides say neither man ordered the crackdown, and the cases appear to have resulted less from a conscious policy change than from the proliferation of e-mail, which makes it possible to trace the origin of some disclosures without pressuring journalists to identify confidential sources.
When Mr. Kiriakou pleaded guilty on Oct. 23 in federal court in Alexandria, Va., David H. Petraeus, then the C.I.A. director, issued a statement praising the prosecution as "an important victory for our agency, for our intelligence community, and for our country."
"Oaths do matter," he went on, "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."
Less than three weeks later, e-mails tripped up Mr. Petraeus himself. He resigned after F.B.I. agents carrying out an unrelated investigation discovered, upon examining his private e-mail account, that he had had an extramarital affair.
Neil H. MacBride, the United States attorney for the Eastern District of Virginia, hailed Mr. Kiriakou's conviction in a statement: "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 leak case is a devastating turn for Mr. Kiriakou, a father of five who considers himself a patriot, a proud Greek-American from Pennsylvania steel country whose grandfather, he recalls, "always talked as if F.D.R. personally admitted him to this country." Discovering a passion for international affairs, he scrounged scholarships to go to George Washington University, where he was recruited by a professor, a former C.I.A. psychiatrist who spotted talent for the agency.
After he was charged last January, his wife, though accused of no wrongdoing, resigned under pressure from her C.I.A. job as a top Iran specialist. The family had to go on food stamps for several months before she got a new job outside the government. To make ends meet, they rented out their spacious house in Arlington, Va., and moved to a rented bungalow a third the size with their three young children (he has two older children from his first marriage).
Their financial woes were complicated by Mr. Kiriakou's legal fees. He said he had paid his defense lawyers more than $100,000 and still owed them $500,000; the specter of additional, bankrupting legal fees, along with the risk of a far longer prison term that could separate him from his wife and children for a decade or more, prompted him to take the plea offer, he said.
Despite his distress about the charges and the havoc they have wrought for his family, he sometimes still speaks with reverence of the C.I.A. and its mission.
But the same qualities that worked well for him in his time as a risk-taking intelligence officer, trained to form a bond with potential recruits, may have been his undoing in his post-C.I.A. role as an intelligence expert sought out by reporters.
"Your job as a case officer is to recruit spies to steal secrets - plain and simple," Mr. Kiriakou said. "You have to convince people you are their best friend. That wasn't hard for me. I'd say half the people I recruited I could be lifelong friends with, even though some were communists, criminals and terrorists. I love people. I love getting to know them. I love hearing their stories and telling them stories.
"That's all great if you're a case officer," he said. "It's not so great, it turns out, if you're a former case officer."
After Mr. Kiriakou first appeared on ABC, talking with Brian Ross in some detail about waterboarding, many Washington reporters sought him out. I was among them. He was the first C.I.A. officer to speak about the procedure, considered a notorious torture method since the Inquisition but declared legal by the Justice Department in secret opinions that were later withdrawn.
While he had spent hours with Abu Zubaydah after the capture, he had not been present when Abu Zubaydah was waterboarded, a fact he made clear to me and some other interviewers. But based on what he had heard and read at the agency, he told ABC and other news organizations that Abu Zubaydah had stopped resisting after just 30 or 35 seconds of the suffocating procedure and told interrogators all he knew.
That was grossly inaccurate - the prisoner was waterboarded some 83 times, it turned out. Mr. Kiriakou believes that he and other C.I.A. officers were deliberately misled by other agency officers who knew the truth.
Mr. Kiriakou, who has given The New York Times permission to describe previously confidential conversations, came across as friendly, courteous, disarmingly candid - and deeply ambivalent about what the C.I.A. called "enhanced interrogation techniques."
He spoke about his career: starting as an analyst on the Middle East at headquarters in Virginia; later being stationed in Bahrain; making the unusual switch to the "operations" side of the C.I.A.; and serving stints as a counterterrorism officer under cover, first in Greece and later in Pakistan (he speaks fluent Greek and Arabic).
When terrorists blew up the Khobar Towers in Saudi Arabia in 1996, killing 19 American servicemen, the blast blew out his apartment windows in Bahrain 16 miles away across the water. Twice overseas, he had close calls with terrorists who were trying to kill Western officials.
He said he had been offered the chance to be trained in the harsh interrogation methods but turned it down. Even though he had concluded that waterboarding was indeed torture, he felt that the C.I.A.'s critics, inflamed by the new revelation that videotapes of the interrogations had been destroyed, were being unduly harsh in judging actions taken in the hectic months after Sept. 11 when more attacks seemed imminent.
"I think the second-guessing of 2002 decisions is unfair," he said in our first conversation. "2002 was a different world than 2007. What I think is fair is having a national debate over whether we should be waterboarding."
His feelings about waterboarding were so mixed that some 2007 news reports cast him as a critic of C.I.A. torture, while others portrayed him as a defender of the agency. Some human rights activists even suspected - wrongly, as it turned out - that the intelligence agency was orchestrating his public comments.
Mr. Kiriakou seemed shellshocked, and perhaps a little intoxicated, by the flood of publicity his remarks on ABC had received and the dozens of interview requests coming his way. We met for lunch a couple of times in Washington and spoke by phone occasionally. He recounted his experiences in Pakistan - the C.I.A. later allowed him to include much of that material in his 2009 memoir, The Reluctant Spy - and readily answered questions about agency lore or senior officials with whom he had worked.
But he occasionally demurred when the subject was too sensitive. I could use information he gave me "on background" - that is, without mentioning him. But we would have to agree explicitly on anything I attributed to him by name, standard ground rules for such relationships.
In 2008, when I began working on an article about the interrogation of Khalid Shaikh Mohammed, I asked him about an interrogator whose name I had heard: Deuce Martinez. He said that they had worked together to catch Abu Zubaydah, and that he would be a great source on Mr. Mohammed, the architect of the Sept. 11 attacks.
He was able to dig up the business card Mr. Martinez had given him with contact information at Mitchell Jessen and Associates, the C.I.A. contractor that helped devise the interrogation program and Mr. Martinez's new employer.
Mr. Martinez, an analyst by training, was retired and had never served under cover; that is, he had never posed as a diplomat or a businessman while overseas. He had placed his home address, his personal e-mail address, his job as an intelligence officer and other personal details on a public Web site for the use of students at his alma mater. Abu Zubaydah had been captured six years earlier, Mr. Mohammed five years earlier; their stories were far from secret.
Mr. Martinez never agreed to talk to me. But a few e-mail exchanges with Mr. Kiriakou as I hunted for his former colleague would eventually turn up in Mr. Kiriakou's indictment; he was charged with revealing to me that Mr. Martinez had participated in the operation to catch Abu Zubaydah, a fact that the government said was classified.
Tensions Over Secrecy
Nothing about my exchanges with Mr. Kiriakou was unusual for a reporter covering intelligence agencies, though he was certainly on the candid end of the spectrum of former C.I.A. officers. Current officials are almost always less willing to speak than retirees. And former rank-and-file officers are usually more reluctant to speak than their bosses, who are more confident in walking up to - or occasionally crossing over - the borders protecting classified information.
Why do officials talk about ostensibly secret programs? Sometimes the motive is self-aggrandizement, or to promote a personal or political agenda. But many officials talk because they feel Americans have a right to know, within limits, what the government is doing with their money and in their name.
There is wide agreement in the government that too much information is classified, and even senior officials are sometimes uncertain about what is secret.
In Senate testimony last July, for example, Michael V. Hayden, the C.I.A. director from 2006 to 2009, admitted that he was perplexed by the "dilemma" over what he was or was not permitted to say, in this case about the targeted killing of Qaeda operatives using drones - officially classified but reported in the news media every day and occasionally discussed by Mr. Obama.
"So much of that is in the public domain that right now this witness, with my experience, I am unclear what of my personal knowledge of this activity I can or cannot discuss publicly," Mr. Hayden said. "That's how muddled this has become."
The trade-offs and tensions over government secrets in a democracy are nothing new. In 1971, when the Nixon administration went to court to try to stop The New York Times from publishing the Pentagon Papers, a classified history of the Vietnam War, Max Frankel, then the Washington bureau chief for The Times, filed an affidavit on how officials and reporters exchange secrets.
"Without the use of 'secrets' that I shall attempt to explain in this affidavit, there could be no adequate diplomatic, military and political reporting of the kind our people take for granted, either abroad or in Washington, and there could be no mature system of communication between the government and the people," Mr. Frankel wrote 42 years ago.
Before Mr. Obama took office, prosecutions for disclosing classified information to the news media had been rare. That was a comforting fact for national security reporters and their sources, but a lamentable one for intelligence officials who complained that leaks damaged intelligence operations, endangered American operatives and their informants and strained relations with allied spy services.
By most counts, there were only three cases until recently: against Daniel Ellsberg and a colleague for leaking the Pentagon Papers in 1971; against Samuel Loring Morison, a Navy intelligence analyst, for selling classified satellite photographs to Jane's, the military publisher, in 1985; and against Lawrence Franklin, a Defense Department official, who was charged in 2005 with passing secrets to two officials of a pro-Israel lobbying group, who shared some of them with reporters.
Thus Mr. Obama has presided over twice as many such cases as all his predecessors combined, though at least two of the six prosecutions since 2009 resulted from investigations begun under President George W. Bush. An outcry over a series of revelations last year - about American cyberattacks on Iran, a double agent who infiltrated the Qaeda branch in Yemen and procedures for targeted killings - prompted Mr. Holder to begin new leak investigations that have not yet produced any charges.
The resulting chill on officials' willingness to talk is deplored by journalists and advocates of open government; without leaks, they note, Americans might never have learned about the C.I.A.'s interrogation methods or the National Security Agency's warrantless wiretapping. But for supporters of greater secrecy, the chill is precisely the goal.
Revealing a Name
From court documents and interviews, it is possible to piece together how the case against Mr. Kiriakou took shape. When he first spoke on ABC in 2007, the C.I.A. sent the Justice Department a "crimes report" - a routine step to alert law enforcement officials to an apparent unauthorized disclosure of classified information. At least half a dozen more referrals went to Justice as he continued to grant interviews covering similar ground.
Shortly after he became a minor media star, Mr. Kiriakou lost his job in business intelligence at Deloitte, the global consulting firm he joined after leaving the C.I.A. He had also begun working with Hollywood filmmakers - visiting Afghanistan, for instance, before advising the producers of The Kite Runner that its young male actors should probably be relocated outside the country for their own safety. He was working with a veteran journalist, Michael Ruby, on his memoir and battling the agency's Publications Review Board, as many C.I.A. authors have, over what he was permitted to write about and what was off limits.
Mr. Rizzo, then a top C.I.A. lawyer, said he recalled some colleagues being upset that Mr. Kiriakou had begun speaking so openly about the interrogation program. "It was fairly brazen - a former agency officer talking on camera," Mr. Rizzo said. "He started being quoted all over the place. He was commenting on everything."
Of course, Mr. Kiriakou had plenty of company. More and more C.I.A. retirees were writing books, speaking to reporters or appearing on television. Mr. Rizzo himself became the subject of a Justice Department referral after he spoke to a Newsweek reporter in 2011 about drone strikes, and his own memoir, The Company's Man, is scheduled for publication next year.
Mr. Rizzo said he did not believe that Mr. Kiriakou's media appearances spurred a serious criminal investigation. "There really wasn't a campaign against him," he said.
Then, in 2009, officials were alarmed to discover that defense lawyers for detainees at Guantánamo Bay, Cuba, had obtained names and photographs of C.I.A. interrogators and other counterterrorism officers, including some who were still under cover. It turned out that the lawyers, working under the name of the John Adams Project, wanted to call the C.I.A. officers as witnesses in future military trials, perhaps to substantiate accounts of torture or harsh treatment.
But initial fears that Al Qaeda might somehow be able to stalk their previous captors drew widespread coverage. This time there was a crimes report, Mr. Rizzo said, that was taken very seriously, both at the C.I.A. and the Justice Department.
F.B.I. agents discovered that a human rights advocate hired by the John Adams Project, John Sifton, had compiled a dossier of photographs and names of the C.I.A. officers; that Mr. Sifton had exchanged e-mails with journalists, including Matthew A. Cole, a freelancer then working on a book about a C.I.A. rendition case in Italy that had gone awry; and that Mr. Cole had exchanged e-mails with Mr. Kiriakou. The F.B.I. used search warrants to obtain access to Mr. Kiriakou's two personal e-mail accounts.
According to court documents, F.B.I. agents discovered that in August 2008, Mr. Cole - identified as Journalist A in the charging documents - had asked Mr. Kiriakou if he knew the name of a covert officer who had a supervisory role in the rendition program, which involved capturing terrorism suspects and delivering them to prisons in other countries.
Mr. Kiriakou at first said he did not recall the name, but followed up the next day with an e-mail passing on the name and adding, "It came to me last night," the documents show. (Mr. Sifton, Mr. Cole and federal prosecutors all declined to comment.)
In recent interviews, Mr. Kiriakou said he believed that the covert officer, whom he had last seen in 2002, had retired; in fact, the officer was then working overseas. He had no idea that the name would be passed on to the Guantánamo defense lawyers and end up in a government file, as it did, he said.
When the F.B.I. agents invited Mr. Kiriakou to their Washington office a year ago "to help with a case," he said, they repeatedly asked him whether he had knowingly disclosed the name of a covert officer. He replied that he had no recollection of having done so; he still insists that was the truth.
"If I'd known the guy was still under cover," Mr. Kiriakou said, "I would never have mentioned him."
The officer's name did not become public in the four years after Mr. Kiriakou sent it to Mr. Cole. It appeared on a whistle-blowing Web site for the first time last October; the source was not clear.
Preparing for Prison
On a chilly recent afternoon, Mr. Kiriakou, in a Steelers jersey, drove his Honda S.U.V. to pick up his son Max, 8, and his daughter Kate, 6, from school, leaving the 14-month-old Charlie at home with a baby sitter.
He and his wife had struggled with how to explain to the children that he is going away, probably in mid-February. They settled on telling the children that "Daddy lost a big fight with the F.B.I." and would have to live elsewhere for a while. Max cried at the news, Mr. Kiriakou said. He cried again after calculating that his birthday would fall on a weekday, so it would be impossible to make the trip to prison to share the celebration with his father.
The afternoon school pickup has become his routine since he has been out of work. A stint as an investigator for the Senate Foreign Relations Committee ended before he was charged; two hedge funds that had him on retainer to provide advice on international security issues dropped him when the charges were filed.
Only Liberty University, the conservative Christian institution founded by Jerry Falwell Sr. in Lynchburg, Va., where Mr. Kiriakou was hired by former C.I.A. officers on the faculty to teach intelligence courses, actually increased the work they offered him when he got in trouble.
"They say torture is un-Christian," Mr. Kiriakou said, who notes wryly that his fervent supporters now include both the Liberty Christians and an array of left-wing activists.
Last summer, Mr. Kiriakou was teaching a practical course on surveillance and countersurveillance to a group of Liberty students in Washington and had them trail him on foot on the eastern edge of Georgetown, he said. After several passes, the students excitedly told him that they had detected several cars that were also following him - his usual F.B.I. minders, he figured.
When Mr. Kiriakou pleaded guilty in October to sharing the covert officer's name, the government dropped several other charges, including the disclosure to The Times and a claim that he had lied to the C.I.A.'s Publications Review Board, though those violations remain in an official statement of facts accompanying the plea.
He expects to be sent to a minimum-security federal prison camp at rural Loretto, Pa., where his fellow residents will include corrupt officials (inmates in recent years have included a Connecticut governor and a New York state senator) and nonviolent drug offenders (the actor Michael Douglas's son, Cameron, currently among them).
Without explanation, he said, his lawyers at Trout Cacheris, a high-end Washington criminal defense firm, recently cut his outstanding bill from more than $700,000 to $492,264.16. "We would appreciate any efforts you can make to reduce the outstanding amount," the firm wrote to him.
But the bill keeps climbing. One recent item: $1,500 for three hours of work - a lunch arranged by one of his lawyers with Mr. Kiriakou and a local professor who spent time at Loretto for stealing government research money, so he could get a firsthand account of life inside the prison camp.