At the height of the furor over Christine Blasey Ford’s accusations against Brett Kavanaugh, the media were filled with speculation that the Supreme Court nominee might withdraw from the nomination battle.

But President Trump, and his top aides, wanted to fight back in the press and on the Hill, especially after Kavanaugh showed White House counsel Don McGahn his decades-old calendars showing he hadn’t attended a party where Ford alleged the assault had taken place.

NEW ACCOUNT REVEALS CLASHES BEHIND SCENES OF KAVANAUGH HEARING

In fact, according to a new book, Trump realized the nomination might fail in the latest #Me-Too frenzy, but if so they wanted to go down fighting.

The behind-the-scenes strategy is revealed in “Justice on Trial: The Kavanaugh Confirmation and the Future of the Supreme Court.” The authors are my colleague Mollie Hemingway, a Fox News contributor and senior editor at the Federalist, and Carrie Severino, chief counsel of the Judicial Crisis Network, which fought for the nomination. They interviewed Trump, top White House officials and several Supreme Court justices, among many others.

The book describes a central conundrum for the judge and his advocates, which is that the team “understood that any criticism of Ford would be treated as a smear” and depicted as “victim shaming.”

Although some of those who knew Ford shared details about her behavior in high school and college that were “dramatically at odds with her presentation in the media,” the book says, the Kavanaugh team decided to focus on his record and the damage to his reputation. The book touches on some of those alleged details involving Ford.

The authors are extremely critical of the coverage of the nomination drama, including in the New York Times and Washington Post, and blame in part “the media’s irrational personal dislike of Kavanaugh.”

READ EXCERPT FROM 'JUSTICE ON TRIAL'

They particularly unload on the New Yorker for publishing the allegations of Deborah Ramirez, a Yale classmate of Kavanaugh who claimed that he exposed himself to her and caused her to touch his genitals. The magazine was unable to find a corroborating witness, acknowledging that Ramirez had “significant gaps” in her memories and that it took her six days of assessing those memories and consulting with a lawyer to name Kavanaugh. He flatly denied the allegations.

SUBSCRIBE TO HOWIE'S MEDIA BUZZMETER PODCAST, A RIFF OF THE DAY'S HOTTEST STORIES

Soon afterward, Michael Avenatti, the lawyer now facing criminal charges in three cases, produced an affidavit from another accuser, Julie Swetnick. She claimed to have attended more than 10 house parties in the early 1980s at which Kavanaugh and a friend became inebriated and sexually assaulted women, and got them drunk so they could be gang-raped.

Hemingway and Severino call the allegations “obviously ridiculous,” saying “no one could have hidden such crimes for decades, much less a man who went on to hold high-profile positions in the White House and then became a judge on the second-most prominent federal court.” Kavanaugh said the charges were from “the Twilight Zone.”

When NBC’s Kate Snow interviewed Swetnick, the network acknowledged that some of her comments on camera “differ from her written statement last week.” Swetnick backed off from saying Kavanaugh had spiked the punch, recalling only that he had handed out the punch. More important, she dropped her claim that Kavanaugh was present at her rape, saying only that she had seen him earlier at the same party.

“Despite Swetnick’s obvious credibility problems, many in the media continued to air her accusations,” the book says.

There was more: Avenatti gave NBC the name of a secret supporting witness, but refused to share it with the Senate Judiciary Committee. But when the woman totally undercut Swetnick’s account—blaming Avenatti for twisting her words—the network sat on the story for awhile.

The authors, who obviously write from a conservative perspective, offer many examples of what they call “the media’s irrational personal dislike of Kavanaugh.” The Times published a story co-authored by Emily Bazelon, who had already announced her opposition to Kavanaugh, saying that in college he was involved in a bar fight that involved throwing ice. (The paper admitted Bazelon was not a newsroom reporter and should not have been used on the story.) In a USA Today column, Erik Brady said Kavanaugh should give up his school coaching duties because “credibly accused sex offenders” should “stay off basketball courts for now when kids are around.”

The judge’s staunchest supporter was his wife Ashley, who had prayed that her husband wouldn’t get the nomination. Ashley sustained herself through the ordeal by praying regularly and studying the Bible.

When Sen. Susan Collins, a key swing vote, gave a lengthy speech saying she would vote to confirm Kavanaugh, Ashley made an emotional call to her husband and told him to watch it. Kavanaugh, who knew that it would have been easier politically for the senator not to support him, texted her a message of thanks and promised that he would not disappoint her.