In February 2003, millions of Americans watched the “60 Minutes” segment that revealed how the FBI mistakenly thought that Brian J. Kelley, a highly respected CIA counterintelligence officer, was the mole who later turned out to be FBI agent Robert Hanssen.When Kelley passed an FBI polygraph test, the FBI decided that meant he was the perfect spy because he could fool the polygraph. When Kelley turned away an FBI agent posing as a Russian intelligence officer, the FBI took that as more confirmation that Kelley was a super spy.In August 1999, the FBI confronted Kelley at CIA headquarters and accused him of being a spy. He was suspended from the CIA with pay and spent the next year under suspicion.On Monday, his wife, Trish McCarthy, found that Kelley had died in his sleep. Pending an autopsy, the family suspects a heart attack. Kelley had just finished a book on his ordeal.Although the outline of his story is well known, how the FBI screwed up the case — and ultimately caught the real spy — is revealed for the first time in my book “The Secrets of the FBI.” In the book, former FBI agent Mike Rochford, who was in charge of the case, forthrightly admits for the first time how wrong he was to focus only on Kelley. The FBI knew that the KGB and its successor, the SVR, were obtaining secrets on American intelligence, including identities of assets the CIA was running and were later executed. But it had no leads pointing to any individual.So Rochford developed a matrix of 58 items that matched the spy he was looking for. Among the items was the fact that the “unsub,” or unidentified subject, had the ability to give the KGB and later the Russian Foreign Intelligence Service (SVR) reports on weekly meetings of the CIA’s counterintelligence center. The spy knew about the FBI’s investigation of State Department official Felix Bloch. He had access to highly classified technical penetrations of Soviet and later Russian establishments. He knew the identities of KGB officers who were spying for the CIA.Because the CIA controlled nearly all the operations that had been compromised, this mistakenly caused the FBI to assume that the spy was in the agency. Beginning with 235 unsubs, Rochford’s MC-43 squad narrowed the list of possible spies to 35, then 16, then 8, and finally one. He was CIA officer Brian Kelley, who had access to most of the programs that had been compromised. He had led the effort within the CIA to investigate Bloch. By coincidence, he lived near Hanssen.“We had every reason to believe that the penetration was in the CIA,” Rochford says. “We were just blatantly wrong in not looking hard enough inside the bureau.”But Rochford points out that the CIA officers working the case also believed the penetration was in the CIA.“We teamed up with the agency on this analysis, and their analysts were every bit as competent as ours,” Rochford says. “And we’d sit around a table at the CIA’s Counterintelligence Center and actually vote about who the most culpable suspect was. And to a person, everyone at the voting table pressed for individuals within the agency. So it wasn’t just us.”Although Rochford still considered Kelley the prime suspect after he passed a polygraph test, he continued to pursue other leads. Desperate to find the spy, Rochford decided to try cold pitches to current and former Russian intelligence officers who might have relevant information and be tempted by big bucks. Specifically, Rochford would offer a million dollars per scalp handed over. That ultimately led to the SVR officer who gave up Hanssen in return for a package valued at $7 million, including the cost of resettlement, training, and annuities.Although he had fingered Kelley unfairly, Rochford turned out to be a hero because he caught Hanssen, who is serving a life sentence without possibility of parole. In contrast, Eric O’Neill, the FBI support employee who is portrayed in the movie “Breach” as being the hero of the case, did little except keep track of Hanssen for six weeks during the three months he was under FBI surveillance.At FBI headquarters, FBI technicians processed and numbered every page of the documents the SVR officer provided on Hanssen, who was still unnamed. They showed that the spy had made significant drops of documents for his Russian handlers in northern Virginia at a time when Kelley was out of the country.“Unless he had a co-conspirator, he couldn’t have been the guy,” Rochford realized.Even though Hanssen had access to most of the information Kelley had, he was not even listed as one of the suspects in the matrix.“Nobody in the bureau was listed,” Rochford says. “We screwed up, no question,” Rockford told me. But, he insists, “Nobody thought the bureau was invulnerable.” Rochford says he vividly remembered the case of FBI agent Richard Miller, who turned out to be a spy. Rochford had personally worked the case of FBI agent Earl Pitts, who also spied for the Russians.At the same time, Rochford admits, “There were different folks within the bureau who thought we should be moving on to other suspects, and they were probably right. We just didn’t.”In 2007, Kelley retired from the CIA, which gave him the Distinguished Career Intelligence Medal. He went to work for Albraxas Corp., a government contractor, and taught counterintelligence to others, including those at the CIA.“It would have been easy for him to be bitter and have turned this into an issue about money and revenge,” Kathleen Hunt, a former CIA officer who was a longtime friend, tells me. “Instead, he turned it into a positive by serving his country by educating those in the government and military on how to do counterintelligence professionally. He even forgave FBI agents who had wrongfully pursued him.”