Josef Müller was a self-made lawyer of sturdy peasant stock, a beer-loving Bavarian with sky-blue eyes, and an Iron Cross hero of the Great War. Because he worked his way through school driving an oxcart, friends ribbed him as Ochsensepp, Joey Ox. The nickname aptly captured Müller’s robust build, his rural roots, and the strong will that brought him such bad and good fortune.

His life was a wild mix of exploits. Müller led troops, smuggled documents, played politics, plotted murder, wrote sermons, rescued Jews, ransomed bishops, eluded capture, suffered betrayal, endured torture, confounded his captors, married his true love, and went to his grave with grace. His wartime interfaith efforts helped spark the reforms of the postwar Second Vatican Council, which hailed the spiritual authenticity of Judaism; and as Germany’s leading advocate of a European Common Market, Müller earned a posthumous reputation as the “godfather” of the European Union. Pope Pius the Twelfth said flatly that Müller “worked wonders.”

During the Nazi years, Müller was a godfather figure in Catholic Munich. Through his legal work he came to sit on boards and control companies: he was by turns a brewer, printer, banker, book publisher, and importer of tobacco. On any given day his waiting room might include a Belgian abbot, a Portuguese consul, a professor of cosmology, the boss of a banned labor union, a dealer in precious stones, and a Metternich baron suffering a breakdown. His law office adjoined the former Wittelsbach palace, now the Bavarian headquarters of the SS, and some of his clients owed their lives or livelihoods to Joey Ox. It was unstated but understood that he might someday ask a small service in return. For those who fell afoul of the Nazis, he was a fixer and a benefactor, a guardian and advocate—part Oskar Schindler, part Vito Corleone.

By 1939, Müller had bound hundreds to him. He was “a popular comrade,” as Gestapo records said—and not just because he did favors. He had what one American spy called “a rather awesome reputation for inexhaustible conviviality.” Once he won three trainloads of German war prisoners in a drinking bet with a Soviet diplomat. But if his blue eyes sparkled partly from wheat beer, he was not an alcoholic, at least not by Bavarian wartime standards. He drank hard but watched his words. When he poured out his feelings freely, or filled his glass too often, he did so only among reliable friends, like the anti-Nazi regulars at a pub near Berlin’s Hotel Kaiserhof. In more sober or less certain circles, he spoke in a semaphore of pregnant gesture. Sometimes, for instance, Müller would grasp the portrait of Hitler that seemed to grace every room in the Reich, set it face down on a table, and say: “He’s up there crookedly. He deserves to be hanged correctly.”

Müller was in Berlin on business on 30 January 1933, when Germany fell into Hitler’s hands. Below his hotel balcony, on the Wilhelmstrasse, thousands of Nazis massed by torchlight, stamping their jackboots, beating drums. He recalled thinking, as he looked down at the flickering faces: It’ll be all over if they’re ever turned loose. “I sensed for the first time what it means when a collective turns individuals into a nameless mass,” he recalled. “It was not a literal fire that had been unleashed here,” but a human inferno—the heat of hate.”

Five weeks later, he ran into a banker friend with SS links. Because the Nazis had never won Bavarian elections, his friend said, they would seize power there by force. The takeover would happen “tomorrow.” Müller rushed to the home of Bavaria’s prime minister, Heinrich Held, who had long relied on him for legal advice. As he helped the diabetic Held inject insulin, Müller urged him to mobilize the state guard. But the prime minister hesitated to inflame the situation.

In the next months, Müller’s best friends began to vanish. Through discreet inquiries he learned that they had landed in the Reich’s first concentration camp, at Dachau. Atrocity tales soon crossed the moors between Dachau and Munich. The SS secretly murdered Jews and humiliated “political Catholics,” Müller heard from the camp’s chief warden, an old war buddy. He produced a photo showing Held’s son with a shaved head, pulling a road roller in a convict’s stripes. Müller slapped the photo down on the desk of Bavarian justice minister Hans Frank, another old friend, who asked Hitler to close Dachau. Hitler kept it open.

By early 1934, Müller’s intrigues had riled the secret police. His name appeared on an SS list of Catholics opposed to the regime. Dachau’s warden warned that Müller himself would soon “arrive” at the camp. A few weeks later, on 9 February, the Gestapo arrested Müller in Munich and charged him with “a treasonous conspiracy… punishable by death.”

Heinrich Himmler directed the interrogation. With his small eyes darting behind rimless glasses, his manicured hands stroking a receding chin, he seemed more schoolmaster than hangman. A stickler for procedure, he ordered a transcript made of the interview.

Himmler asked what advice Müller gave Held during the takeover. Müller told the truth. He admitted that he urged having Himmler shot. As the head of government then, Held could have legally ordered it. Wouldn’t Himmler have made the same recommendation in Müller’s position?

Müller’s courage confounded Himmler. An Allied Intelligence officer later posited that Müller, “a tough and two-fisted political infighter,” was “the type of man-sprung-from-the-people whom the Nazis loved to claim as their own and who, as an opponent, rather daunted them.”

Somewhat awed by his prisoner’s will, Himmler invited him to join the SS. Müller refused. “I am philosophically opposed to you. I am a practicing Catholic, and my brother is a Catholic priest. Where could I find the possibility of a compromise there?” Himmler congratulated Müller on his “manly defense” and let him go.

Shortly after Müller’s release, an SS man called on him. Hans Rattenhuber, a thirty-seven-year-old ex-cop, commanded Hitler’s bodyguard. A tall man with plain values, he saw most of the Nazi bosses as corrupt sycophants, and admired Müller for standing up to Himmler. Ever since word went round that he had admitted urging Himmler’s execution, Rattenhuber had wanted to meet Joey Ox.

Over steins of beer, they became friends. Rattenhuber cherished their beer brotherhood because it gave him the chance, so rare in a dictatorship, to speak his mind. Müller relished Rattenhuber’s rants because they revealed Nazi plans against the Church. Thus developed one of the singular friendships of the Second World War, in which the head of Hitler’s bodyguard regularly revealed SS secrets to a Vatican spy.

Munich Cardinal Michael Faulhaber did not actually ask Josef Müller to spy. Though they were fraternity brothers, and addressed each other with the familiar “du,” Faulhaber used an intermediary—a husky monsignor with horn-rimmed glasses and a bulbous nose—who also, it seems, did not directly ask Müller to engage in espionage. Instead, Monsignor Johannes Neuhäusler, who used the codename “Casanova,” asked Müller to help save the Leo Haus, an insolvent holding company for Catholic media. Müller thus became what Vatican officials called “a trusted collaborator.” The work became more secret and more dangerous until, by Müller’s account, it seemed “almost sacrilegious.” But in long walks through the Englischer Garten, Munich’s central park, Neuhäusler helped Müller get his mind around the Church doctrine of the Disciplina Arcani, the Way of Secrecy.

The first popes were martyred to a man: the emperors sent some of them to Sardinia, where each had the nerve at the back of his right knee severed, his right eye gouged out and cauterized with molten iron; and then, if under thirty, he endured castration. In the ensuing centuries, scarcely a year had passed when the Church was not at war in the world. One hundred seventy times usurpers drove a pontiff from the city, and thirty-three times killed him on Peter’s Chair. The ninth and tenth centuries alone saw John the Twelfth decapitated, John the Fourteenth starved, Adrian the Third poisoned, Benedict the Sixth asphyxiated, Stephen the Eighth dismembered, Leo the Fifth bludgeoned, Stephen the Sixth strangled, Stephen the Seventh garroted, John the Eighth clubbed to death, John the Tenth suffocated under a pillow, and Boniface the Seventh beaten unconscious, left under a statue of Marcus Aurelius, and stabbed to death by passersby.

Popes had therefore learned to defend themselves. By the seventh century, Pope Martin the First had targeted spies against potential kidnappers; and since then, tips from secret papal agents had saved dozens of pontiffs from death or capture. The Church justified these and other secret operations not just by Jesus’s example, but also by Aquinas’s doctrine, which allowed ambushes and other secret means in the conduct of a just war. During the Counter-Reformation, Jesuits had expanded Aquinas’s teaching to justify plots against Protestant kings; and during Italian unification, the Vatican used agents provocateur to lure rebels to Perugia, where Swiss Papal troops beheaded them.

What Neuhäusler proposed seemed by comparison tame. He wanted Müller to hold on to some files. Since Neuhäusler had hired Müller to save the Leo Haus, they could claim attorney-client privilege if the Nazis ever tried to seize the documents. When Müller agreed, he became an agent in a counter-Nazi secret service.

“We need to be prepared for an uphill battle,” Cardinal Faulhaber had said at the first meeting of the Munich Ordinariat after Hitler took power. “It will be important that our defense and resistance measures are uniformly directed, and that all the intelligence is collected in one place.” Faulhaber asked Neuhäusler to take on that “serious and dangerous job,” and to coordinate the project with the Vatican.

In April 1933 Neuhäusler traveled to Rome. Although Cardinal Secretary of State Pacelli had just begun negotiating the Reich concordat, he already saw the need for a central registry of concordat violations. Neuhäusler described the situation as perilous: hooting thugs pummeled street collectors for charities, horsewhipped worshipers as they left Mass, trashed Catholic printers and dumped trays of broken type in the streets. But of these flagrant acts, Neuhäusler brought stories rather than proof. “Send us reliable reports!” he reported Pacelli saying. “Otherwise, we can’t help you.”

Müller’s law office became the central registry Pacelli wanted. Joey Ox collated reports of concordat violations from the Munich archdiocese and from the Bavarian Jesuits, whose Kaulbachstrasse headquarters he passed on his way to work. Although Neuhäusler told his sources to keep their “eyes and ears open for anything,” they focused on press censorship the imprisonment of leading Catholics. So much material poured in that Neuhäusler and Müller had to disperse it daily to backup sites in case the SS mounted an illegal search.

To verify the information, Müller built a network of agents. He sounded army, college, and law-school friends with access to Nazi officials—a community of the well-informed, who worked in newspapers, banks, and even, as with Hans Rattenhuber, the SS itself. One of Müller’s more colorful informants, “Sister” Pia Bauer, ran a charity for Nazi Old Fighters, and styled herself a Nazi nun; the price of information from this harpy was to drink with her in a side room of the Eidenschink bank, and whenever Müller met her, he noted, “she lifted her skirt and showed a scar on her bare ass,” which she had received as the only woman to march with Hitler during his failed 1923 Beer Hall putsch, and which she displayed so often that “she was not even wearing a panty.”

More difficult than acquiring intelligence was getting it safely to Rome. SS spies opened bishops’ mail and tapped their phones, keeping a special watch lest their complaints reach the wider world. To evade Nazi surveillance, Father Neuhäusler relied on a trusted network of clandestine couriers.

One courier was film critic and children’s author Ida Franziska Sara Schneidhuber, a convert to Catholicism, whom one Church official later described, with a loaded sigh, as “Jewish, divorced, and probably a lesbian, but devoted to the faith.” Vital reports flowed to her through Munich Jesuit Father Rupert Mayer, “who was able to visit Frau Schneidhuber inconspicuously,” as Neuhäusler noted, so that “much valuable intelligence found its way… to Rome. For many years this intelligence channel worked quickly and well,” until finally, in 1941, the SS arrested Schneidhuber as a non-Aryan, and in 1942 killed her in the concentration camp at Theresienstadt.

The key courier, however, was Joey Ox. “He did a lot of dangerous things,” a Jesuit priest later said of Müller. “He was a brave man. He needed to have a firm character. He was flying this tiny little sports plane from Germany into Italy, bringing over these documents to Merano, and there he gave them to somebody who would take them to Pacelli in the Vatican.”

Müller’s secret services soon came to Pacelli’s attention in Rome. As a reward, Pacelli arranged for Müller to marry his fiancée, Maria, above the rumored tomb of Saint Peter in the Vatican crypt. On 29 March 1934, Father Neuhäusler wrapped his stole around Josef and his bride’s joined hands, tightly and for a long time, to emphasize the strength of their union. Pacelli meanwhile used Müller’s bulletins to write protest notes to Berlin. A Jesuit priest then stowed the reports on a high shelf in Pacelli’s library, in the secret cavity of a big red book.

One of the red book’s reports haunted Pacelli. Speaking at an SS training school, Hitler vowed: “I’ll step on the Catholic Church like a toad!” One of the lapsed-Catholic cadets, stricken by conscience, related the remark in a letter to his bishop. Soon afterward, the cadet and a friend of like sympathies died in a purportedly accidental fall from the Munich-Berlin express train. The Vatican’s new secret source in the SS, Hans Rattenhuber, said the tragedy fit Himmler’s known methods of dealing with suspected traitors.

Himmler still suspected Müller, too, of treason. Rattenhuber provided regular warnings. Although the SS seemed unaware of Müller’s Vatican work, they knew his law firm represented many Jews, who sought to emigrate after the November 1938 Night of Broken Glass.

Müller wondered whether he also should leave, but he did not want his family to become dependents and beggars. He chose to stay and fight, and made a pact with Pacelli. Müller would work harder for him, offering that work to God, and Pacelli would pray for him every day.

This covenant consoled Müller, especially after Pacelli became pope Pius the Twelfth. The Holy Father seemingly had pressed a talisman into his hand. Müller drew strength from it in April 1945, as he walked to the gallows—just he had during all the years when, as a friend later said, he “sat down to breakfast each morning with a rope around his neck,” secretly linking Pius Twelfth and German generals in three plots to kill Adolf Hitler.

Excerpted from Church of Spies: The Pope’s Secret War Against Hitler. Copyright © 2016 by Basic Books. Reprinted with permission from Basic Books.