WASHINGTON (WASHINGTON POST) - Again and again, President Donald Trump was instructed not to do it.
A cadre of advisers, confidants and lawmakers all urged him - implored him, really - not to personally attack the women who had accused Supreme Court nominee Brett Kavanaugh of sexual assault.
So he did it anyway.
Addressing thousands at a boisterous rally in Mississippi, Mr Trump relied on his own visceral sense of the moment and mocked Dr Christine Blasey Ford for gaps in her memory, directly impugning the accuser's credibility.
Establishment Republicans initially reacted with horror. But Mr Trump's 36-second off-script jeremiad proved a key turning point towards victory for the polarising nominee, White House officials and Kavanaugh allies said, turbocharging momentum behind Judge Kavanaugh just as his fate appeared most in doubt.
On Tuesday evening in Southhaven, Mississippi, Mr Trump laid into Ford with the ruthlessness of an attack dog and the pacing of a stand-up comedian.
The crowd roared with laughter and applause. Aides privately crowed as footage of the performance was played and replayed many times over, shifting the national discussion from scrutiny of Judge Kavanaugh's honesty and drinking habits to doubts about Dr Ford's memory.
And in Washington, Republican senators - though they condemned Mr Trump's mockery of Dr Ford - felt emboldened to aggressively demand Judge Kavanaugh's confirmation, which became a near-certainty on Friday and looks to become official with a vote on Saturday.
"As long as he was willing to go to the mat for him, it fortified probably people up here, too," said Senator John Thune of South Dakota, the chamber's third-ranking Republican leader.
The three-week maelstrom - from when Dr Ford first shared her story with The Washington Post to Saturday's expected confirmation vote - fused the nation's cultural reckoning over sexual assault with tribal politics, carrying ramifications not only for next month's mid-term elections but also for the long-term identities of both political parties.
At the centre, as always, was Mr Trump, who used his bully pulpit to champion Judge Kavanaugh and accused men everywhere.
Initially restraining his combative impulses and deferring to the Senate on process, the President ultimately followed his own gut as if he were, in the description of one aide, "a strategic boogeyman".
The result is likely to be, according to counsellor to the President Kellyanne Conway, "a crowning achievement of his presidency".
"If people look at this as an apocalyptic fight, he's the ultimate fighter who doesn't give up, doesn't give in and doesn't back down, even if there's an avalanche of criticism and vicious, vile reactions from the other side," Ms Conway said.
Yet for all of Mr Trump's public declarations, the actual deciders of Judge Kavanaugh's fate were a trio of Senate Republicans with an independent streak - Ms Lisa Murkowski of Alaska, Ms Susan Collins of Maine and Mr Jeff Flake of Arizona - whose demands for an FBI investigation prolonged the process but also ended up ensuring Judge Kavanaugh's confirmation.
Republican leaders, who for nearly two years have accommodated Mr Trump's brushfires in service to a shared agenda, ploughed through the chaos to fulfil a wish of the movement right: Replacing the Supreme Court seat held by swing vote Anthony Kennedy with a conservative ideologue.
The GOP's hardball approach left Democrats shaken and defeated.
"They are succeeding because they have broken all the rules and norms," said Senator Richard Blumenthal, a Connecticut Democrat. "They adopted the strategy that the best defence is a good offence."
This portrait of Judge Kavanaugh's fraught confirmation process is the result of interviews with more than two dozen senators, Senate staffers, White House officials and outside Republican advisers, some of whom spoke on the condition of anonymity because they were not authorised to discuss behind-the-scenes machinations.
After three weeks of uncertainty and pitched partisanship, it was Ms Collins on Friday who all but determined the outcome in an extraordinary 44-minute address on the Senate floor.
The Maine moderate had signalled her thinking earlier with a "yea" on a procedural vote to move forward, before sitting down to lunch with Senate Majority Leader Mitch McConnell, a Kentucky Republican, in the members-only Senate dining room.
Ms Collins struck defiant notes in defence of Judge Kavanaugh and lambasted liberal activists and senators, whom she argued never gave the nominee a fair shake.
Although she said she found Dr Ford's testimony "sincere, painful and compelling" and believes she has survived a sexual assault, she explained in some detail that she did not see any substantiating witnesses or evidence for her claims that Judge Kavanaugh was the aggressor.
The final words of her address were the ones many GOP leaders had been longing to hear: "I will vote to confirm Judge Kavanaugh."
Mr McConnell led the Republican senators - nearly two dozen in attendance - in a standing ovation. One by one, Ms Collins' compatriots celebrated her decision. Senate Judiciary Committee Chairman Charles Grassley, an Iowa Republican, enveloped Ms Collins in a giant bear hug.
Within moments, Senator Joe Manchin, a West Virginia Democrat, became the only Democrat to say he would vote to confirm Judge Kavanaugh, and coupled with Mr Flake's earlier expression of support all but guaranteed the nominee's ascension to the Supreme Court.
From the moment Justice Kennedy announced his retirement on June 27, the White House realised the battle to fill his seat would be far more difficult than the one for Justice Neil Gorsuch to replace the late Antonin Scalia.
Picking a successor for Justice Kennedy's swing seat gave Mr Trump an opportunity to solidify a conservative majority on the court for decades to come - and White House advisers decided they would need to mount a vigorous political campaign.
The chief strategist was Mr Donald McGahn, the White House counsel who has had a tempestuous relationship with Mr Trump but rose up through the conservative movement.
Mr Trump, too, understood the stakes, aides said. If he could solidify the Supreme Court's conservative majority, the President calculated, that move alone could permanently endear him to Republican voters - especially evangelical Christians - and override doubts about how he conducts himself in office.
Mr Trump had no particular personal affinity for Judge Kavanaugh, although a dinner was arranged between the two men and their wives to cultivate a relationship.
"I don't even know him," the President told the Mississippi crowd, "so it's not like, 'Oh, gee, I want to protect my friend.'"
Nevertheless, Mr Trump felt invested in Kavanaugh, and he entrusted Mr McGahn, with whom the President barely was on speaking terms, to muscle through this final victory before departing the White House later this fall.
"Kavanaugh's an establishment guy. He was a Bush guy," said Senator Lindsey Graham, a South Carolina Republican, referencing the nominee's experience as White House staff secretary under President George W. Bush.
"There was a lot of pushback, you know - 'Don't go (down) that road,' 'That's not why you won,' and he said, 'Wait a minute. I want to pick the best people to be on the court I can,' and he said he was incredibly impressed by his background, just the whole package of Kavanaugh."
Mr McGahn built a war room on the fourth floor of the Eisenhower Executive Office Building staffed with nearly a dozen lawyers, two communications operatives and a stable of Kavanaugh's former law clerks.
A farm team at the Justice Department conducted research and drafted talking points. Mr Leonard Leo, a longtime leader of the conservative Federalist Society, and to a more limited degree Republican lawyer William Burck, were key advisers. And an assortment of well-funded outside groups, including the Judicial Crisis Network, worked to buff Judge Kavanaugh's public image through television and online advertisements and surrogate media appearances.
The team treated Judge Kavanaugh like they would a presidential candidate, including choreographing his public movements. When Judge Kavanaugh visited Capitol Hill, Mr McGahn and an entourage of clerks and aides accompanied the judge to meetings with senators and devised routes to avoid interactions with protesters.
Still, even the Kavanaugh operation drew pointed criticism from Republican allies on Capitol Hill and others in Mr Trump's orbit, who at times privately questioned everything from the selection of Kavanaugh himself to the war room's ability to effectively manage a bloody-knuckled partisan brawl.
The story of Judge Kavanaugh's nomination can be told in two parts. Until Sept 16, he was a milquetoast Bush Republican whose confirmation hearings had failed to animate much of the country.
But that Sunday, when The Washington Post published Dr Ford's detailed account of sexual assault when she and Judge Kavanaugh were teenagers in suburban Maryland, the Supreme Court nomination gripped the nation - casting Judge Kavanaugh as a predator with a drinking problem for some and an unfairly smeared folk hero for others.
The initial Ford allegations momentarily sent the White House reeling, as they scrambled to assess her credibility and the veracity of her claims. The President was immediately advised, including by Ms Conway, not to attack Dr Ford, but to say that she deserved to be heard - a line he stuck to for several days.
In the coming day, stories of Judge Kavanaugh's alleged debauchery as a high school and college student dribbled out from former classmates, as well as two additional claims of sexual misconduct: Ms Deborah Ramirez claimed in the New Yorker that Judge Kavanaugh had exposed himself to her as an undergraduate at Yale University, and Ms Julie Swetnick, represented by attorney and potential Democratic presidential candidate Michael Avenatti, suggested that Judge Kavanaugh had been present at parties where women were gang-raped.
But the additional claims had an unexpected effect: Widely deemed less credible than Dr Ford's assault allegation, they gave Judge Kavanaugh's supporters fresh ammunition to cast all of the charges as a political hit job.
Judge Kavanaugh, a former political staffer who had micromanaged his confirmation process and media coverage of his nomination, was eager to defend himself publicly - and Mr McGahn, Mr McConnell, Mr Trump and other advisers were encouraging him to do just that.
Judge Kavanaugh and his wife, Ashley, sat for a television interview with Fox News Channel's Martha MacCallum.
The interview was widely criticised - "objectively a horrible idea", in the words of one White House official. Judge Kavanaugh appeared wooden and dispassionate, sticking only to a few talking points, and Mr Trump, an avid consumer and critic of television news, thought he appeared weak and unconvincing.
But the Kavanaugh team believed the Monday sit-down served its purpose: He was on camera denying allegations in clips that helped fill the news vacuum in the run-up to that Thursday's scheduled Senate testimony from him and Dr Ford.
"It filled the void," a second White House official said.
Then came the whiplash - more than eight hours of Senate testimony, first from Dr Ford, then from Judge Kavanaugh, that captivated the nation and even left the President seesawing from fatalism to enthusiasm about Judge Kavanaugh's confirmation prospects.
When Dr Ford had finally finished, Mr McGahn spoke privately to Judge Kavanaugh, who had not watched, urging him to be passionate.
"Speak from your heart," Mr McGahn advised the nominee, according to someone familiar with their discussion.
Judge Kavanaugh roared into the committee room and shouted his opening statement, which he had personally written the night before with the help of one trusted clerk.
The hotly defiant performance was so effective in the eyes of his advisers - and, perhaps most importantly, of the President - that a group gathered in Vice-President Mike Pence's Capitol Hill office began to cheer and pump their fists. Some even had tears in their eyes.
The hearing galvanised activists on both sides and left jittery senators - including Mr Flake, one of 11 Republicans on the Judiciary Committee - torn between competing accounts and party loyalties.
Mr Flake, who has repeatedly criticised Trump's rhetoric and had been positioning himself as the pivotal swing vote on Judge Kavanaugh's nomination, decided to vote "yes" last Friday to advance Judge Kavanaugh's nomination from the committee to the full Senate floor.
But Mr Flake was confronted that day in a Senate elevator by two women who tearfully accused him of dismissing credible allegations of assault. He told fellow senators the FBI should reopen its background investigation to review the sexual misconduct allegations.
Mr Flake, along with Ms Murkowski and Ms Collins, met with Mr McConnell and the committee's Republican members in the leader's Capitol office and said they would not vote to confirm Judge Kavanaugh until there had been an FBI investigation.
The trio laid out the scope of the probe, which would take no more than one week and which they decided would not include Ms Swetnick's claims.
"How do we confine it to credible allegations versus any number of things that we would've expected to come out?" recalled Senate Judiciary member Thom Tillis, a North Carolina Republican.
Mr Mr McConnell spoke with Mr Trump and convinced him that the only option was to delay a vote and move forward with the FBI probe, according to people familiar with their conversation.
Mr McConnell understood that Ms Murkowski, who generally keeps her own counsel, was the true wild card. After being personally lobbied by sexual assault survivors from Alaska, she announced on Friday morning that she would not vote to confirm Judge Kavanaugh.
In the closing days of the Kavanaugh fight, Mr Trump's role was mostly public-facing.
His aides conceded that the President would not have much sway with the trio of Republicans who were on the bubble.
"I think in terms of the people that we needed to in the end win over, it's sometimes the less said is better," Mr Thune said, referring to Mr Trump's role.
On the campaign trail, however, Mr Trump ratcheted up the partisan warfare at his rallies.
In Mississippi, the President - already fuming over a New York Times investigation into his family's allegedly fraudulent tax schemes - felt the media was not properly scrutinising Dr Ford's account and decided to engage.
"How did you get home? 'I don't remember,'" Mr Trump said, reenacting Dr Ford's hearing. "How did you get there? 'I don't remember.' Where is the place? 'I don't remember.' How many years ago was it? 'I don't know. I don't know. I don't know.'"
The riff lasted less than a minute, but had lasting ramifications. The senators whose votes Judge Kavanaugh was wooing said they were aghast at the President's rally-stage behaviour.
But Kavanaugh allies saw a clear benefit: An argument by the President that bucked up Judge Kavanaugh, discredited Dr Ford and became a clarion call for conservatives.
More than two dozen Trump supporters interviewed at the President's campaign rally Thursday in Minnesota said they wish he had not gone after Dr Ford, fretting that doing so was not presidential.
Yet many also acknowledged the President had simply spoken aloud what many of them thought privately.
"There are things he says that I wish he wouldn't say, but I will take it - for all that he has done, I'll take it," said Mr Matthew Hoffland, 24, a web developer from Sparta, Wisconsin. "It fired up his base."