Donald Trump staggered into Sunday night’s second presidential debate with a single goal: rally his splintering party by taking the fight to its common enemy. He tried to do it in a manner that only he would.

Barely 48 hours after a video revealed Trump boasting about groping women, the reeling Republican nominee unleashed a desperate onslaught of brutal attacks at Hillary Clinton. He called Clinton a liar, then dubbed her “the devil.” He essentially threatened to jail her if elected. And he brought into the debate hall several women who alleged her husband assaulted them.

“She has tremendous hate in her heart,” Trump said, as his Democratic opponent stood, stone-faced, just a few feet away.

Just a month before Election Day, Trump turned in the nastiest debate performance in modern political history. In one stunning exchange, he turned a grilling about his boorish behavior into a disquisition on former President Bill Clinton’s sexual history and his rival’s alleged role in discrediting his accusers. “I think it’s disgraceful, and I think [she] should be ashamed of herself,” Trump said.

For tens of millions of viewers watching at home, shame may have been the dominant emotion. As a rule, presidential candidates do not behave the way Trump did on Sunday night. But the churlish clash was not a surprise. The damage inflicted by the video left Trump’s campaign in meltdown and plunged the Republican Party into crisis. Dozens of senior GOP figures openly called for the party’s presidential nominee to quit the race, and Trump’s own running mate called his comments indefensible. If Trump can no longer win the White House — and it is hard to find a professional Republican who hasn’t at least privately written off his campaign — he was determined to make Clinton’s coronation an ugly one.

The performance seemed to remind some Republicans why they liked him in the first place. Trump bullied his way to the GOP nomination, disposing of 16 seasoned politicians with crude insults and schoolyard boasts, and the fusillade of insults he fired at Clinton seemed to calm shaken GOP officials. Two Republican committee members told TIME that while they had been ready to bolt his campaign, his aggressive performance justified sticking around.

“I think he defended himself,” said former New York City mayor Rudy Giuliani, a close Trump ally, “in a way in which the people of the United States will say, ‘That’s the guy I want fighting for us,’ not that woman — not that person who looked so exhausted by the end of the debate.”

It’s unlikely that Trump swayed many swing voters during the 90-minute slugfest at Washington University in St. Louis. But his furious jabs inflicted some damage on Clinton, who was forced to defend her use of a private email server, remarks she made in paid speeches — released by WikiLeaks on Friday — and her record as a Senator. She appeared rattled at times by her opponent’s open hostility and breaches of decorum.

Yet Clinton, who now enjoys a comfortable advantage in the race for the White House, was almost a secondary player in a debate dominated by the drama surrounding Trump. What was billed as a town hall turned into a grisly spectacle before what might have been a record-breaking audience. The first debate, just two weeks ago, broke previous records — and that was before the Republican nominee was revealed to have discussed getting away with sexual assault because he is famous.

When the matter was raised by moderator Anderson Cooper, Trump delivered what passes, in his view, for an apology. He said he had engaged in “locker-room talk” that left him ashamed. But then he launched into an attempt to relitigate all of Bill Clinton’s scandals with women.

That was what some of his advisers — and many of his fans — had wanted all along. Shortly before the debate, Trump called a small group of reporters to hear from some of Bill Clinton’s accusers and a woman who was raped by a client Hillary Clinton defended as his lawyer. Clinton’s campaign had briefed her on Trump’s intended psych-out. One top Clinton aide laughed that after staring down Chinese and Russian Foreign Ministers, a billionaire reality-show star is nothing. “Donald, I know you’re into big diversion tonight,” Clinton said as he hammered her. “Anything to avoid talking about your campaign, and how it’s exploding, and how Republicans are leaving you.”

The candidates’ refusal even to shake hands at the start of the debate foreshadowed the ugliness to come. The pair slung insults and ignored time limits to get one last swipe in. Trump sneered through his responses as he absentmindedly paced the stage, and repeatedly interrupted Clinton as she spoke. The former Secretary of State, who absorbed Trump’s jabs with a tight smile and a clenched jaw, repeatedly began hers with expressions of disbelief. “I’m sorry I have to keep saying this,” the former Secretary of State said, “but he lives in an alternative reality.”

Trump arrived with retorts at the ready. But he didn’t always have his facts correct. He said Clinton was responsible for U.S. foreign policy inaction after President Obama famously declared that Syria’s use of weapons against its own people would cross a line in the sand. Clinton stepped down months before it was confirmed Syria had, in fact, crossed that line. When she pointed out the error, he grudgingly conceded it. “I agree she wasn’t there. But she was possibly consulted,” he said.

Trump once again defended Russia and its leader, Vladimir Putin, from U.S. accusations that it has mounted a campaign to undermine faith in the American electoral process. He also praised the Russian government and Syrian strongman Bashar Assad for attacking ISIS, while ignoring a question comparing the humanitarian disaster they have caused in Aleppo to the Holocaust. “Assad is killing ISIS. Russia is killing ISIS. And Iran is killing ISIS,” Trump said.

In between shots at Clinton, he criticized the moderators. “It’s nice. One on three,” he moaned at one point. At another juncture, Trump seemed to be paying more attention to the countdown clocks in the hall than to what Clinton was saying. “She just went 25 seconds over her time,” Trump complained. Co-moderator Martha Raddatz of ABC News set the record straight: “She did not.” But the repeated invocation of media bias foreshadowed a tactic Trump will employ in the waning weeks of the campaign for supporters whose distrust of the media is encoded in their DNA.

In the spin room after, the Trump campaign was buoyant. “Biggest victory in the history of debates,” crowed campaign aide Stephen Miller. It wasn’t remotely true, but even if it were, Trump faces huge challenges. Not least of them: repairing an apparent rift with running mate Mike Pence, who refused to defend Trump as the disavowals piled up over the weekend. During one of the few sustained policy discussions on Sunday night — Syria was the topic — Trump broke with Pence, who said last week that the U.S. should strike Assad’s forces if the Russian government continues to assist in furthering the humanitarian crisis. “He and I haven’t spoken, and I disagree,” Trump said. “I disagree. I think you have to knock out ISIS.” Unlike the first debate, Pence decided not to sit in the audience in St. Louis

Even if Trump can mend the wounds in his own party, he faces an uphill fight to erase Clinton’s growing lead. The Republican has deep organizational deficits in must-win states. Polls have shown him sliding. Female voters will be tough to win, especially after his lewd remarks about grabbing their anatomy. A CNN focus group found that just 1 of 29 undecided voters from Ohio — a state that had been slipping from Clinton’s grasp — thought Trump had won. Its broader poll, too, found viewers saying Clinton had won by a 57% to 34% margin.

Meanwhile, voters are already casting early ballots in many states. If Trump is to turn this around in the next four weeks, the converts he would need to win may have already cast their vote against him in disgust.

— With reporting by Zeke J. Miller / St. Louis

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Alex Altman at alex_altman@timemagazine.com and Philip Elliott at philip.elliott@time.com.