Establishment Republicans thought he was one of them.

William Barr had returned to private life after his first stint as attorney general when he sat down to write an article for The Catholic Lawyer. It was 1995, and Mr. Barr saw an urgent threat to religion generally and to Catholicism, his faith, specifically. The danger came from the rise of “moral relativism,” in Mr. Barr’s view. “There are no objective standards of right and wrong,” he wrote. “Everyone writes their own rule book.”

And so, at first, it seemed surprising that Mr. Barr, now 69, would return after 26 years to the job of attorney general, to serve Donald Trump, the moral relativist in chief, who writes and rewrites the rule book at whim.

But a close reading of his speeches and writings shows that, for decades, he has taken a maximalist, Trumpian view of presidential power that critics have called the “imperial executive.” He was a match, all along, for a president under siege. “He alone is the executive branch,” Mr. Barr wrote of whoever occupies the Oval Office, in a memo to the Justice Department in 2018, before he returned.

Now, with news reports that his review into the origins of the Russian investigation that so enraged Mr. Trump has turned into a full-blown criminal investigation, Mr. Barr is arousing fears that he is using the enormous power of the Justice Department to help the president politically, subverting the independence of the nation’s top law enforcement agency in the process.

Why is he giving the benefit of his reputation, earned over many years in Washington, to this president? His Catholic Lawyer article suggests an answer to that question. The threat of moral relativism he saw then came when “secularists used law as a weapon.” Mr. Barr cited rules that compel landlords to rent to unmarried couples or require universities to treat “homosexual activist groups like any other student group.” He reprised the theme in a speech at Notre Dame this month.

Barr uses the same language and ideas in an article and speech separated by decades.

1995

Article in The Catholic Lawyer, “Legal Issues in a New Political Order”

Highlighted text appears in both quotations

2019

Remarks to the Law School and the de Nicola Center for Ethics and Culture at the University of Notre Dame

In 1995 and now, Mr. Barr has voiced the fears and aspirations of the conservative legal movement. By helping Mr. Trump, he’s protecting a president who has succeeded in confirming more than 150 judges to create a newly conservative judiciary. The federal bench now seems more prepared to lower barriers between church and state and reduce access to abortion — a procedure that Mr. Barr, in his 1995 article, included on a list of societal ills that also included drug addiction, venereal diseases and psychiatric disorders.

In his unruffled and lawyerly way, Mr. Barr emerged as the president’s most effective protector in the spring, when he limited damage from the special counsel Robert Mueller’s investigation of Russian interference in the 2016 presidential election by shaping the public narrative of the Mueller report before he released any of it.

In his pursuit of investigating the investigators, he even traveled to Britain and Italy to meet with intelligence officials there to persuade them to help it along. Now it is possible the Justice Department could bring charges against its own officials and agents for decisions they made to investigate Trump campaign advisers in the fraught months around the 2016 election, when the Russian government was mounting what the Mueller report called “a sweeping and systematic” effort to interfere.

This criminal investigation seems ominous in the context of Mr. Barr’s other moves.

Dec. 19, 1991, Attorney General William P. Barr speaks with reporters. Assistant Attorney General Robert Mueller stands at right.Barry Thumma/AP Photo

His Justice Department recently declined to investigate a whistle-blower’s complaint that the president was “using the power of his office to solicit interference from a foreign country in the 2020 U.S. election” and advised the acting director of national intelligence not to send the complaint to Congress. Last week, dozens of government inspectors general warned in a letter to the Justice Department that its position “could seriously undermine the critical role whistle blowers play in coming forward to report waste, fraud, abuse and misconduct across the federal government.”

So while Rudolph Giuliani is freelancing American diplomacy as the president’s personal lawyer, often leaving bedlam in his wake, and Mick Mulvaney flails as acting chief of staff, Mr. Barr has used the Justice Department, with precision, on the president’s behalf. The New York City Bar Association complained a few days ago that Mr. Barr “appears to view his primary obligation as loyalty to the president individually rather than to the nation.”

William Barr (Billy, when he was young) grew up in an apartment on Riverside Drive in Manhattan with a framed Barry Goldwater presidential campaign poster in the foyer, according to Vanity Fair. His mother, who was of Irish descent, taught at Columbia University. His father, a Jew who converted to Catholicism, taught at Columbia, too, and then became the headmaster of the elite Dalton Schoolleaving after 10 years amid criticism over his authoritarian approach to student discipline.

He went to high school at the equally elite Horace Mann and to college at Columbia, where he majored in government and then got a master’s degree in government and Chinese studies. Mr. Barr went to work for the C.I.A. in Washington in 1973 and attended George Washington University Law School at night.

He joined the Reagan White House in 1982, where he sought to curb regulation. After George H.W. Bush was elected president in 1988, he became director of the Office of Legal Counsel in the Justice Department, which provides legal advice to the president and all executive agencies.

It didn’t take long for Mr. Barr to express his views on executive power. He warned in one of his early opinions, in July 1989, of congressional “encroachments” on presidential authority. “Only by consistently and forcefully resisting such congressional incursions can executive branch prerogatives be preserved,” he wrote. Some of his Republican colleagues remember being taken aback.

Bill’s view on the separation of powers was not overlapping authority keeping all branches in check, but keeping the other branches neutralized, leaving a robust executive power to rule. George III would have loved it,” said Douglas Kmiec, a law professor at Pepperdine who preceded Mr. Barr as head of the Office of Legal Counsel.

Mr. Barr also argued that the president had the “inherent authority” to order the F.B.I. to abduct people abroad, in violation of an international treaty principally written by the United States. This view reversed the position that the Office of Legal Counsel had taken nine years earlier. When Congress asked to see Mr. Barr’s opinion, he refused, even as the government defended the abduction of a man in Mexico accused of participating in the killing of a Drug Enforcement Administration agent. The charges against the man were dismissed. It took four years for his opinion to come to light.

You have a secret opinion that violated the internal rules of the Justice Department” and “diminished America’s reputation as a country that operates by the rule of law,” said Harold Hongju Koh, a Yale law professor who worked in the Office of Legal Counsel and advised the State Department. “At the time, we thought that was as bad as it was going to get.”

After becoming deputy attorney general in 1990, he continued to push the limits on questions of presidential power. He told the first President Bush that he didn’t need congressional approval to invade Iraq. Mr. Bush asked for it anyway.

Mr. Barr with President George H.W. Bush in 1992.Marcy Nighswander/Associated Press

Mr. Barr, who took over the department in the fall of 1991, also urged Mr. Bush to pardon all six of the Reagan administration officials who faced criminal charges in an arms-for-hostages deal at the heart of the Iran-contra scandal. The president took his advice.

When Mr. Bush lost his bid for re-election, Mr. Barr went back into private practice before taking jobs as the general counsel first for GTE and then Verizon. He served on the boards of several religious groups, including the Catholic Information Center, a self-described “intellectual hub,” affiliated with the ultraconservative order Opus Dei.

Those groups include other conservative Washington insiders, such as Leonard Leo, the executive vice president of the Federalist Society. Mr. Leo has also served on the board of the Catholic Information Center and he came out strongly in favor of Mr. Trump’s nomination of Mr. Barr for attorney general.

In a sense, both Mr. Barr and Mr. Leo have found parallel ways to use the Trump administration as a vehicle for their causes. Mr. Leo has enormous influence from outside the government on the selection of judicial nominees. And from the inside, Mr. Barr plays a role in federal judicial appointments and has supported a Justice Department task force set up to look for cases of religious discrimination.

When Mr. Barr undercut the Mueller report, he lost some supporters. While delaying its release, he presented the conclusions as far less damning for President Trump than Mr. Mueller found them to be. (For example, Mr. Barr said that the special counsel did not find sufficient evidence of a crime when in fact Mr. Mueller had not exonerated Mr. Trump of wrongdoing.)

Not in my memory has a sitting attorney general more diminished the credibility of his department on any subject,” wrote Benjamin Wittes, the editor in chief of Lawfare.

Despite criticism, Mr. Barr has continued to champion the presidency — and this president. But on Friday, a federal judge in Washington ruled against the Justice Department’s effort to block Congress from getting grand jury evidence obtained in the Mueller investigation. The department has also asked a federal judge to block a subpoena from the Manhattan district attorney for eight years of Mr. Trump’s personal and corporate tax returns.

“From my perspective,” Mr. Barr told Jan Crawford of CBS News in May, “the idea of resisting a democratically elected president and basically throwing everything at him and, you know, really changing the norms on the grounds that ‘we have to stop this president,’ that is where the shredding of our norms and our institutions is occurring.”

In other words, amazingly, it wasn’t President Trump, or Attorney General Barr, who was violating the norms of American governance. It was their critics.

Since Watergate, a crucial norm of Justice Department independence has prevented presidents from ordering or meddling in investigations for partisan reasons.

In 2001, Mr. Barr praised the first President Bush for leaving the Justice Department alone. Mr. Bush’s White House “appreciated the independence of Justice,” Mr. Barr said. “We didn’t lose sight of the fact that there’s a difference between being a government lawyer and representing an individual in his personal capacity in a criminal case.”

Now, Mr. Barr seems hard-pressed to maintain a semblance of those boundaries. The criminal investigation of the origins of the Russia investigation that he ordered is official government business. It’s headed by an experienced prosecutor, John H. Durham, the United States attorney for Connecticut, and it’s supposed to be on the up and up.

Mr. Barr in May testifying before the Senate Judiciary Committee about the Justice Department’s investigation into Russian interference with the 2016 election.Erin Schaff/The New York Times

But when Mr. Barr told Congress in April that he thought “spying” on the Trump campaign by American intelligence agencies occurred — the F.B.I. director, Christopher Wray, told Congress that “spying” was “not the term I would use” — he echoed President Trump’s conspiracy theory of being a victim of the “deep state.” And in the last month, Mr. Barr has found his review mixed up with the machinations of Mr. Giuliani, who was directed by Mr. Trump to investigate the 2016 election and the Biden family in Ukraine.

Mr. Trump made the overlap explicit when he lumped Mr. Giuliani and Mr. Barr together in his July phone call with Ukraine’s president, Volodymyr Zelensky. “I will have Mr. Giuliani give you a call and I am also going to have Attorney General Barr call,” Mr. Trump told Mr. Zelensky, according to notes released by the White House. Mr. Barr was reportedly “surprised and angry” by the president’s reference, and a Justice Department representative has denied he had any contacts with Mr. Zelensky.

Then, Mr. Mulvaney, the acting White House chief of staff, brought up Mr. Barr’s review of the Russia investigation at his news conference on Oct. 17 in defense of Mr. Trump’s request to Mr. Zelensky for “a favor” and information. (“So you’re saying the president of the United States, the chief law enforcement person, cannot ask somebody to cooperate with an ongoing public investigation into wrongdoing?” Mr. Mulvaney asked.)

The White House’s use of the Justice Department as a shield in the Ukraine scandal risks leaving Mr. Barr’s review “hopelessly compromised,” tweeted the Harvard Law School professor Jack Goldsmith, an alumnus of the Office of Legal Counsel who has defended Mr. Barr.

And in blockbuster testimony before Congress last Tuesday, the top American diplomat in Ukraine, William Taylor, said that he and Gordon Sondland, the ambassador to the European Union, who was conveying Mr. Trump’s orders concerning Ukraine, discussed the possibility that Ukraine’s prosecutor would make a public statement about “investigations, potentially in coordination with Attorney General Barr’s probe.” Either people in the president’s circle are using Mr. Barr as a pawn, or he’s in deeper than he has said.

Either way, maybe the lesson is the same one that applies throughout the administration: The fallout from the president’s maneuvering taints the people around him. The longer Mr. Barr stays in office, the more that Mr. Trump will look for the attorney general to do for him.

When Mr. Mueller closed up shop, he left several cases pending with the Justice Department,including charges against the Trump operative Roger Stone, which could end with disclosures at trial that damage the president (Mr. Stone has pleaded not guilty). What if Mr. Trump would rather make cases like these go away, with pardons or other inducements? Will Mr. Barr go along?

Mr. Barr has echoed President Trump’s conspiracy theory of being a victim of the “deep state.” Doug Mills/The New York Times

During the Bush administration, in a more moderate time, Mr. Barr worked for a buttoned-down president who called for a “kinder” and “gentler” strain of Republicanism. Now he has a boss who calls the impeachment process “a lynching,” Republican critics “human scum” and the news media “the enemy of the American people.”

As the buttons fly off, Mr. Barr still seems unperturbed. He’s the perfect attorney general for President Trump. Not so much, it seems, for the country.