In 1932, an author using the name Diplomat released a spy novel called “Murder in the Embassy.” As the CIA had not yet been founded, the thriller concerned a fictional intelligence agency called the Bureau of Current Political Intelligence (CPI). The agency was headed by a “suave, debonair, unflappable” man named Dennis Tyler.

The author’s real name was John Franklin Carter. He was an economist for the State Department who also wrote magazine journalism under the name Jay Franklin. Carter believed he could become Dennis Tyler, and time proved him right.

After also writing a nonfiction book that year about the presidential candidates, he became friends with Franklin Delano Roosevelt.

When the State Department discovered his alter ego and made him choose between working there or writing, Carter chose the latter and became a full-time journalist, taking an office in the National Press Building. His travels took him to Germany, and just before the election, FDR picked his brain about events there. Carter’s writings in the ensuing years heavily favored FDR’s policies.

As revealed in the new book “Bureau of Spies: The Secret Connections between Espionage and Journalism in Washington” (Prometheus Books), by Steven T. Usdin, the National Press Building in Washington, DC, was a longtime haven for spycraft. It housed many of the country’s top journalists, and foreign and domestic infiltrators and propagandists used journalism as a cover for more nefarious information-gathering and -spreading activities.

While US journalists soured on American intelligence agencies after the revelations of Watergate, cooperating with the CIA was once seen as patriotic by many in the US journalistic establishment.

“Major news agencies, such as CBS News and The New York Times, cooperated extensively with the CIA,” Usdin writes. “The agency slipped its officers into newsrooms, usually with the knowledge and consent of newspaper publishers and television network CEOs. New York Times publisher Arthur Hays Sulzberger signed a secrecy agreement with the CIA and allowed it to disguise about 10 officers as Times journalists, stringers or clerical staff in the 1950s.”

By February 1941, the sad state of American intelligence in the face of rising European fascism weighed on Carter, who viewed his fictional CPI as an agency that, if it existed, could assist the United States at a crucial time.

He proposed just such an agency, with himself in charge, saying that America needed ‘‘a small and informal intelligence unit operating out of the White House without titles, without any bulls–t.’

FDR, viewing Carter’s role as a popular columnist as the “perfect cover,” agreed, under the condition that their work together be kept quiet. The unit would not be given a name, although it would have an unofficial budget.

“The president financed Carter’s work from a slush fund Congress had provided to deal with unspecified ‘emergencies,’ ” Usdin writes. “Money for Carter’s operation, starting at $64,000 for the remainder of 1941 and growing to $120,000 for 1943 (equivalent to about $2 million in 2016), was laundered by the State Department.”

Under the name Jay Franklin, Carter wrote a popular syndicated column called We, the People, and sometimes wrote pieces for the New York Post.

Meanwhile, he sent hundreds of secret memos from the press building to the president over the next four years, on everything from the availability of natural resources (for use in war supplies) to Japanese infiltration of the Philippines, with the president replying on White House stationery.

Over time, Carter brought on other agents who would travel the globe uncovering information, and FDR kept them “immensely busy,” not just with war intelligence, but with what we know today as opposition research.

Carter and his team helped FDR squelch the popularity of American hero, anti-Semitic America First leader and Roosevelt opponent Charles Lindbergh.

In April 1941, FDR asked Carter to find ammunition he could use against the aviator known as Lucky Lindy, who had befriended Nazi leaders and was spreading propaganda in the US about how “neither the United States nor England could win a war against Germany.”

“FDR’s strategy for neutralizing Lindbergh was typically indirect,” Usdin writes.

“He asked Carter to prepare a detailed study of the ‘Copperheads,’ a term of derision that had been applied during the Civil War to Southern sympathizers and defeatists in the North,” according to Usdin. “Carter gave Roosevelt a 55-page report on April 22 and was in the Oval Office three days later for a typically raucous White House press conference.”

During the conference, a reporter planted by the president asked why the Army, in a time of dire need, had not asked Lindbergh to re-enlist. FDR talked about the Copperheads, making it clear he viewed Lindbergh as one of them. At first, newspapers took Lindbergh’s side. But FDR knew that Lindbergh couldn’t stay quiet.

Three days later, the aviator resigned from the military, “citing the president’s remarks about ‘my loyalty to my country, my character and my motives.’ ” Given that Americans were being drafted en masse, Lindbergh’s action seemed like cowardice, and his reputation never recovered.

Carter’s most essential contribution to American intelligence was, sadly, disregarded. In the fall of 1941, FDR asked him to assess the loyalty of Japanese-Americans living on the West Coast. One of Carter’s agents spent three weeks “interviewing FBI agents, military intelligence officials and people from all walks of life — businessmen, students, fish packers, lettuce pickers and farmers — to assess the loyalty of the Japanese community.”

The report — compiled with the knowledge that internment of Japanese-Americans was being considered — strongly recommended against it, noting that Japanese-Americans would not, by and large, trade loyalty to their home country for the same to their ancestry. It also noted that “the Japanese government distrusted American-born Japanese and was very unlikely to recruit them as intelligence operatives or saboteurs.”

The report’s findings were ignored, and Japanese-Americans were interned en masse.

Another report from Carter to FDR, in December 1942, gave the president his most reliable and complete look to that point at the dire realities of the Holocaust, including the first news to reach the president about the Belzec concentration camp and the existence of “mobile extermination trucks in which poison gas was used to murder Jews.”

Carter even flipped a top Hitler associate, Dr. Ernst Sedgwick “Putzi” Hanfstaengl, and brought him to America with FDR’s blessing. Hanfstaengl provided copious information on Hitler and the Nazis, and when an isolationist journalist threatened to go public with the information, Carter arranged for the story to be reported by an FDR supporter instead — namely, John Franklin Carter himself, slipping into his journalist identity with no clue to his readers of his role in bringing Hanfstaengl to the United States. Carter’s story, written for a syndicate, appeared in newspapers across the country, including on the front page of The New York Times.

When Roosevelt died on April 12, 1945, “his personal files contained over 3,000 pages of correspondence with Carter, [and] profiles of hundreds of Nazis that Hanfstaengl had compiled,” Usdin writes.

Carter wrote to new President Harry Truman, telling him of his team’s efforts and asking to continue.

But Truman saw no need for the unit and ended the relationship (although Carter wound up being hired as a Truman speechwriter three years later).

Carter passed away on Nov. 28, 1967, at the age of 70. Usdin writes that he suffered a heart attack “and died in his chair, behind a desk in his office in the National Press Building.”