Former president Donald Trump wanted to choose Amy Coney Barrett to be his second Supreme Court nominee in 2018 but ultimately chose Brett M. Kavanaugh, a former top Trump aide writes in a new book.

Mark Meadows, who was Trump’s chief of staff from 2020-2021, writes that Trump “had wanted to go to Justice Barrett before he nominated Brett Kavanaugh in 2018.”

“We had passed over her then in favor of a more establishment-friendly nominee, and that decision had come back to bite us,” Meadows writes in “The Chief’s Chief.” “The president was determined not to make the same mistake twice.”

Meadows was a member of Congress and chairman of the House Freedom Caucus when Trump chose Kavanaugh as his nominee to succeed Justice Anthony M. Kennedy on the country’s top court.

The Washington Post reported at the time that Kavanaugh was on Trump’s shortlist, along with Barrett and federal judge Raymond Kethledge. Trump eventually nominated Barrett to the court in 2020, after the death of Justice Ruth Bader Ginsburg.

In his book, Meadows writes that Trump was disappointed with some of the decisions by Kavanaugh and his first Supreme Court pick, Neil M. Gorsuch, after they were confirmed to the court. Both justices “had both ruled in ways that were deeply disappointing to the MAGA movement that had made their appointments possible,” Meadows writes, blaming Gorsuch and Kavanaugh’s “establishment” ties.

According to Meadows, Trump was also “extremely put off” by Kavanaugh’s declaration to members of the Senate Judiciary Committee that he “liked beer.” Kavanaugh made the statement during his seething testimony in response to California professor Christine Blasey Ford’s accusation that he sexually assaulted her when they were both teenagers.

“He was also disappointed by Judge Kavanaugh’s almost apologetic testimony during the Senate confirmation hearings, which he viewed as being weak,” Meadows writes of Trump. “If there is one thing for which President Trump has absolutely no tolerance or patience, it’s weakness. For a short time, he strongly considered dropping Kavanaugh in favor of another, stronger candidate.”

In her 2019 book “Supreme Ambition: Brett Kavanaugh and the Conservative Takeover,” Washington Post deputy editorial page editor Ruth Marcus wrote that after Ford’s accusations came to light, Trump’s daughter Ivanka Trump and son-in-law Jared Kushner advocated finding another candidate, as did Leonard A. Leo, the influential executive vice president of the Federalist Society.

Former White House counsel Donald McGahn strongly favored sticking with Kavanaugh and refused to take Trump’s calls after Ford’s testimony for fear Trump wanted to pull the plug on the nomination before Kavanaugh could deliver his response, according to Marcus.

Meadows writes that during a trip together aboard Air Force One while the battle over Kavanaugh’s nomination was underway, Trump proposed to him the idea of dropping Kavanaugh in favor of another nominee.

“In any event, I let the president know that if he dropped Kavanaugh as a candidate, the blowback could be severe,” Meadows writes. “It would be viewed by the press as a failure and as a victory by his enemies on the left. . . . In the end, President Trump’s combative spirit won the day.”

After Ginsburg’s death in September 2020, Trump called Meadows — who was then White House chief of staff — to “discuss our next steps.” Meadows writes that he and then-White House counsel Pat Cipollone “believed Amy Coney Barrett to be the perfect nominee, the president agreed wholeheartedly.”

Meadows also writes that a few months earlier, Trump had been considering Barrett’s husband, Jesse Barrett, for a potential federal judgeship. Jesse Barrett had previously worked as an assistant U.S. attorney in Indiana.

Robert Barnes contributed to this report.