As I investigated the hidden hand of the C.I.A. in the Watergate affair for my new book, Scorpions’ Dance: The President, the Spymaster, and Watergate, I sifted the fictional oeuvre of burglar-in-chief Howard Hunt for factual clues.

In the years before his arrest, Hunt had published seven paperback adventures of Peter Ward, a pipe-smoking C.I.A. operative who outwitted treacherous Communists from Hong Kong to New Delhi while taking orders from an impressive deputy director back at headquarters named Avery Thorne. Thorne resembled no one so much as Hunt’s great friend Richard Helms, the real-life, pipe-smoking director of the agency from 1966 to 1973.

“Thorne resembled a broker or financier rather than spymaster,” Hunt wrote of Thorne in one of his novels. “His manners were somewhat elegant, and he could don the air of affability for the Hill, but professionally, he was as single minded as a monk on hazardous duty.”

Howard Hunt following a meeting with the Watergate Investigative Committee, 1973.

It wasn’t until I gained access to Hunt’s correspondence with William F. Buckley in the Yale University library that I realized Hunt’s spy fiction was actually an undercover mission in the cultural cold war, ordered up by Helms himself with the goal of burnishing the C.I.A.’s public reputation at a moment when it was facing public criticism for the first time.

Hunt, a career C.I.A. officer who wrote constantly when he was not running secret operations to overthrow governments in Guatemala and Cuba, fancied himself the agency’s answer to Ian Fleming, the former naval intelligence officer whose James Bond novels glamorized Britain’s Secret Intelligence Service. When Fleming died, in August of 1964, Helms envisioned Hunt succeeding him as a mythmaker of Anglo-American intelligence. “It’s a magnificent opportunity,” the spymaster told his friend.

In 1965, Fleming’s U.S. publisher, New American Library, commissioned Hunt to write a series about the adventures of a C.I.A. officer, written under the pen name David St. John.

“I’ve finished the first of the [espionage] series books and am polishing it,” Hunt wrote to Buckley in early 1965. The two men had been close since Hunt hired Buckley to work at the C.I.A.’s station in Mexico in the early 1950s. Buckley soon left espionage for opinion journalism, but the two men remained close friends.

Hunt’s book was On Hazardous Duty, a thriller introducing Peter Ward as the American 007. That summer, Helms arranged a paid sabbatical for Hunt in Spain with no intelligence duties. Within a year, Hunt finished three more Peter Ward books, Festival for Spies, The Venus Probe, and The Towers of Silence.

Helms touted “David St. John’s” books to his friend Jack Valenti, the chief of the Motion Picture Association of America. Valenti, in turn, passed Hunt’s stories to Paramount Pictures. Few spy novelists came so well recommended. Few inspired such poor reviews.

“While the David St. John paperbacks may be quite acceptable to readers of this sort of international intrigue action melodrama,” wrote a Paramount script reviewer in 1968, “they are indifferent screen material.... Peter Ward does seem pretty dull—and he has no one to talk to… a loner without humor and with little or no personal life or personal charm is not a character to win an audience easily.”

Then C.I.A. director Richard Helms in Washington, D.C., 1967.

Helms went on to recommend Hunt to the White House. In July 1971, a year before the burglary, chief of staff H. R. Haldeman relayed the C.I.A. director’s description of Hunt to the president. “Helms says he’s ruthless, quiet and careful. Low profile. He gets things done.” Nixon approved the hiring of Hunt.

Meanwhile, Helms, a better spy than critic, did not give up on Hunt’s books. In May 1972, the C.I.A. director attended a Washington screening of the new hit movie The Godfather. Helms brought along copies of Hunt’s books, which he gave to Charles Bluhdorn, chief executive of Gulf and Western Industries, the corporate conglomerate that owned Paramount Pictures. Bluhdorn passed the books to his senior vice president at Paramount, Martin Davis, for his assessment. Peter Ward, alas, had not aged well. The books, advised Davis, were “a bunch of crap” that “couldn’t possibly do the Agency any good.”

“It’s a magnificent opportunity,” the spymaster told his friend.

Within a month, disaster swamped both Hunt and Helms. As ringleader of the five burglars arrested in the offices of the Democratic National Committee, Hunt was a wanted man. Nixon demanded Helms kill the F.B.I.’s investigation. Helms balked, preferring to protect himself and his agency. In November of 1972, the newly re-elected Nixon fired the C.I.A. director in a tense meeting at Camp David.

In January of 1973, Hunt was convicted of burglary and conspiracy charges and sent to prison. Helms, by contrast, moved on smartly with an appointment as U.S. ambassador to Iran. When called to testify at the Senate Watergate Committee’s nationally televised hearings, Helms gave the impression he barely knew Hunt.

Nixon waves before entering the Marine One helicopter to return home to California on August 9, 1974, the morning after announcing his resignation.

“Well, Mr. Hunt was—had a, well, he had a good reputation,” Helms said. “There was some questions at various times during his employment about how well he carried out certain assignments.... It was just a question of his effectiveness. Mr. Hunt was a bit of a romantic.”

While Helms enjoyed life in the palatial ambassador’s residence in Tehran, Hunt spent 33 months in federal prison on Eglin Air Force Base, in Florida. Throughout Hunt’s ordeal, Buckley remained a stalwart friend, writing letters, consoling Hunt’s children, extending loans, and calling for a presidential pardon.

By the time Hunt was released, in early 1977, Helms had retired and returned to Washington. Later that year, Helms pleaded guilty to misleading Congress about an assassination operation in Chile, making him the first C.I.A. director convicted of a crime.

In the spring of 1978, Hunt was lunching at the Metropolitan Club in Washington when Helms suddenly came into view.

“When was the last time you saw Mr. Hunt?,” Helms was asked in a 1984 court deposition.

“Saw Mr. Hunt?,” Helms gulped. “I believe I saw Mr. Hunt way across the Metropolitan Club dining room four or five years ago, but I’m not sure that it was he.”

Hunt was sure it was Helms. “I was lunching in D.C. at the Metropolitan last month,” he wrote to Buckley. “Dick Helms was nearby and we stared wordlessly at each other. Appropriate. I thought, Dick having testified so often that he didn’t know me.”

Jefferson Morley is the author of Scorpions’ Dance: The President, the Spymaster, and Watergate, to be published on June 7 by St. Martin’s Press