Matthew Whitaker, whom President Donald Trump named as his acting attorney general on Wednesday, privately provided advice to the president last year on how the White House might be able to pressure the Justice Department to investigate the president’s political adversaries, Vox has learned.

Whitaker was an outspoken critic of special counsel Robert Mueller’s probe before he became the chief of staff to Attorney General Jeff Sessions in September 2017. That has rightfully raised concerns that Whitaker might now attempt to sabotage Mueller’s investigation. But new information suggests that Whitaker — while working for Sessions — advocated on behalf of, and attempted to facilitate, Trump’s desire to exploit the Justice Department and FBI to investigate the president’s enemies.

In May 2018, President Donald Trump demanded that the Justice Department open a criminal investigation into whether the FBI “infiltrated or surveilled” his presidential campaign and whether Obama administration officials were involved in this purported effort. Trump, his Republican allies in Congress, and conservative news organizations — most notably Fox News — were making such claims and amplifying those of others, even though they offered scant evidence, if any, that these allegations were true.

Sessions, Rosenstein, and other senior department officials believed that if they agreed to Trump’s wishes, doing so would constitute an improper politicization of the department that would set a dangerous precedent for Trump — or any future president — to exploit the powerful apparatus of the DOJ and FBI to investigate their political adversaries. Those efforts, in turn, coincided with the president’s campaign to undermine Mueller’s investigation into whether the president’s campaign aides, White House advisers, and members of his own family colluded with Russian to help Trump win the 2016 election.

During this period of time, Whitaker was the chief of staff to Attorney General Jeff Sessions, and in that role was advising Sessions and Deputy Attorney General Rod Rosenstein on how to counter the president’s demands. But according to one former and one current administration official, Whitaker was simultaneously counseling the White House on how the president and his aides might successfully pressure Sessions and Rosenstein to give in to Trump’s demands.

Sources say that Whitaker presented himself as a sympathetic ear to both Sessions and Rosenstein — telling them he supported their efforts to prevent the president from politicizing the Justice Department. A person close to Whitaker suggested to me that the then-chief of staff was only attempting to diffuse the tension between the president and his attorney general and deputy attorney general, and facilitate an agreement between the two sides.

But two other people with firsthand information about the matter told me that Whitaker, in his conversations with the president, presented himself as a vigorous supporter of Trump’s position and “committed to extract as much as he could from the Justice Department on the president’s behalf.”

One administration official with knowledge of the matter told me: “Whitaker let it be known [in the White House] that he was on a team, and that was the president’s team.”

Whitaker’s open sympathizing with Trump’s frequent complaints about the Mueller investigation resulted in an unusually close relationship between a president and a staffer of his level. The president met with Whitaker in the White House, often in the Oval Office, at least 10 times, a former senior administration official told me. On most of those occasions, Sessions was also present, but it’s unclear if that was always the case.

During this period, Whitaker frequently spoke by phone with both Trump and Chief of Staff John Kelly, this same official told me. On many of those phone calls, nobody else was on the phone except for the president and Whitaker, or only Kelly and Whitaker. As one senior law enforcement official told me, “Nobody else knew what was said on those calls except what Whitaker decided to tell others, and if he did, whether he was telling the truth. Who ever heard of a president barely speaking to his attorney general but on the phone constantly with a staff-level person?”

Despite this being the case, on Friday as he was leaving on a trip to Paris, Trump told reporters, “I don’t know Matt Whitaker.” He also claimed that he never spoke to the then-DOJ chief of staff about the Mueller investigation: “I didn’t speak to Matt Whitaker about it,” he said.

Whitaker was a White House ally in building the case to investigate Hillary Clinton

Whitaker also counseled the president in private on how the White House might be able to pressure the Justice Department to name a special counsel to investigate not only allegations of FBI wrongdoing but also Hillary Clinton. Trump wanted the Justice Department to investigate the role that Clinton purportedly played, as secretary of state, in approving the Russian nuclear energy agency’s (Rosatom) purchase of a US uranium mining company.

The FBI had earlier investigated the allegations, concluded that there was no evidence of wrongdoing, and closed out its investigation. Trump presented no new evidence to the Justice Department that would justify reopening the investigation, and thus senior Justice Department officials considered the president’s request to be a blatant attempt to improperly use the Department and FBI to discredit a political adversary.

Yet Whitaker suggested to the White House that he personally was sympathetic to the appointment of a special counsel to investigate these matters, according to the two officials with knowledge of the matter. A Justice Department official told me: “You have to have a predicate to open an investigation, or to reopen a closed case. You have an even higher one, an extraordinary threshold, to appoint a special counsel. If you don’t, what you are doing is unethical as a lawyer.”

A person close to Whitaker suggested that he did what so many others around Trump do, which is tell the president what he wants to hear: “With Sessions and Rod, [Whitaker] said he was on their side, and thought the appointment of a special counsel was ludicrous.”

Whitaker was a longtime Mueller skeptic

It had long been feared that the president would fire either Sessions — who had recused himself from involvement in the Russia investigation, to Trump’s ire — or Rosenstein, and appoint someone to replace one or both of them, which would lead to the Mueller probe being overseen by a loyalist to the president who would curtail or even sabotage the investigation. Those fears were realized with lightning speed on Wednesday when the president demanded Sessions resign and named Whitaker as the acting attorney general. The Justice Department said in a statement that Whitaker would now supervise the special counsel’s investigation.

Before he became Sessions’s chief of staff, Whitaker was one of the staunchest critics of Mueller’s investigation. In a July 2017 appearance on CNN, for example, Whitaker spoke of various ways the White House might sabotage Mueller’s probe. Whitaker suggested that if Sessions were to resign or be fired, his replacement might be able to curtail the investigation by simply refusing to fund it further.

“I could see a scenario where Jeff Sessions is replaced with a recess appointment and that attorney general doesn’t fire Bob Mueller, but he just reduces his budget to so low that his investigation grinds to almost a halt,” Whitaker said.

The previous month, Whitaker, appearing on a conservative radio show, said he was sure that the president and his men did nothing wrong: “The truth is there was no collusion with the Russians and the Trump campaign,” he declared.

John Q. Barrett, a professor at St. John’s Law School and a former associate Iran-Contra prosecutor, tweeted after the president named Whitaker acting attorney general: “Whitaker told me in June 2017 that he was flying out from Iowa to NYC to be on CNN regularly because he was hoping to be noticed as a Trump defender, and through that to get a Trump judicial appointment back in Iowa.”

In August 2017, as a CNN legal commentator, Whitaker authored an op-ed titled “Mueller’s investigation of Trump is going too far.” He wrote: “It is time for Rosenstein, who is the acting attorney general for the purposes of this investigation, to order Mueller to limit the scope of his investigation.” The following month, Whitaker was named Sessions’s chief of staff.

The president’s relationship with Sessions and Rosenstein has famously been largely one of animosity and disdain. But in Whitaker, the president found a reliable and compliant friend. As the New York Times reported, “The president has long regarded Mr. Whitaker as his eyes and ears inside a department that he considers an enemy institution.” The Washington Post similarly reported, “As Sessions’s chief of staff, Whitaker met with the president in the Oval Office more than a dozen times, normally accompanying the attorney general. ... When Trump complained about the Mueller investigation, Whitaker often smiled knowingly and nodded in assent.”

But even for a Trump loyalist, the facts stymied further investigation

In May, after Trump demanded the Justice Department investigate the FBI, several members of Congress, after reviewing classified information on the matter, said they could find no evidence to lend credence to the allegations that the FBI possibly “infiltrated or surveilled” his presidential campaign.

Rep. Tom Rooney (R-FL), who sits on the House Intelligence Committee and is a reliable Trump supporter, said he concluded the allegations were “untrue.” House Speaker Paul Ryan said he could find no evidence of wrongdoing. Even Trump’s attorney, Rudy Giuliani, has conceded that the president made his claims about campaign “spying” based on unsubstantiated information he didn’t know to be true.

As I previously reported for Vox, after Trump’s demands of the Justice Department, Sessions, Rosenstein, and other senior department officials were in a bind. To accede to a presidential demand — especially one based on specious evidence — would politicize and compromise the independence and integrity of the department, some senior DOJ officials strongly believed.

But there was also good reason to believe that Trump, if he did not get his way, would retaliate. Officials feared that Trump might fire the attorney general or Rosenstein, jeopardizing Mueller’s investigation.

Rosenstein came up with what appeared to be an adroit compromise to diffuse the situation. He decided that — rather than the DOJ itself opening the criminal investigation the president had demanded — he would instead ask the Justice Department’s inspector general to look into the matter. Trump, placated, agreed to the arrangement, and stood down.

By requesting the inspector general conduct an inquiry of the FBI, Rosenstein and other senior department officials believed they were acting ethically. Although an investigation by the DOJ’s IG could result in criminal charges, the agency conducts reviews of systematic failures within the department. Thus, there is no predicate of criminal behavior necessary to begin such a review.

As the New York Times reported at the time, Rosenstein’s supporters saw his response to Trump as a “deft deflection” that achieved three immediate needs: “It neutered a troubling request, appeared responsive to the president’s demands and allowed Mr. Rosenstein to keep his job.”

But critics — among them senior current and former Justice Department officials — argued that by acceding, Rosenstein did irreparable damage to the department. Matthew Miller, who served as the Justice Department’s spokesperson during the Obama administration, told me, “The inspector general does not exist to disprove presidential conspiracy theories, or even legitimize them by investigating them in the first place. And the deputy attorney general should not be participating in a presidential attempt to conduct an investigation based on no evidence — and sought only to discredit the lawful investigations of the president and his campaign aides.”

The fig leaf comes off

To placate the president’s demand that a special counsel be named to investigate Hillary Clinton’s role in the uranium deal, Rosenstein and other Justice Department officials came up with a similar compromise: Instead of naming a special counsel, Sessions agreed to appoint John Huber, the US attorney for Utah, to review the department’s earlier investigation. If he found evidence of any serious wrongdoing, Huber could then recommend the opening of a formal criminal investigation or even the appointment of a special counsel.

A long-time Justice Department trial attorney told me, “This is the first time, perhaps since Watergate, that the department has been asked to review old, closed files about a president’s political opponents. It’s not right that it should have been done at all. Yet you can argue that Sessions did this in the most benign way possible. He did refuse to open a criminal investigation without cause, and he stood firm by refusing to appoint a special counsel.”

Sessions wrote to several Republican members of Congress in March to say that Huber’s review was a top priority: “I receive regular updates from Mr. Huber and upon the conclusion of his review,” so as to consider “whether any matters merit the appointment of a special counsel.” At the highest levels of the Justice Department, Huber’s review has been considered to be little more than a publicity or political stunt to placate Trump.

Now, however, with Whitaker as acting attorney general, and the future of the Mueller investigation in jeopardy, it will be up to him to make the final decision on whether a special prosecutor will investigate Hillary Clinton.