It’s not an American habit for a presidential candidate to declare that he would imprison his opponent. Donald Trump, reeling from the release of an 11-year-old video recording his lewd and repulsive comments about women, went there anyway.

And while he said he was “very embarrassed” by his talk of groping and assault, Trump decided that salvation lay in dredging up old scandals involving his opponent’s husband. Of Bill Clinton, he said: “There’s never been anybody in the history of politics in this nation that’s been so abusive to women.” Trump seemed to think that the comparison would somehow make him look better.

Trump stalked the stage, interrupting Hillary Clinton, repeatedly attacking her for “lying,” and assailing the moderators, Martha Raddatz and Anderson Cooper, saying at one point that the debate was three against one. It was the petulant and often boorish performance of a man aware that his campaign was at the edge of extinction.

Clinton hit back hard on Trump’s history of sexist comments, his refusal to release his tax returns, the untruthfulness of many of his claims and charges, his proposal to ban Muslim immigration and his closeness to Russian President Vladimir Putin.

Democratic presidential nominee Hillary Clinton. (Tasos Katopodis/Agence France-Presse via Getty Images)

But Clinton remained calm and confident, her demeanor reflecting the reality of the debate: That Trump’s meandering and often ill-informed answers and his angry aggressiveness would play badly with voters harboring doubts about whether he has the temperament to be president. He left those doubts in place, and he may even have deepened the quiet qualms of his own running mate by openly disagreeing with Mike Pence’s views on U.S. policy toward Russia and Syria.

Clinton knew that she did not have to do much to take advantage of the troubles the video created for Trump. She argued that it should not be viewed in isolation but as part of a pattern of sexism and abusive comments about women. “It represents exactly who he is,” she said, and showed he was not fit for the presidency.

The paradox of the evening is that everything Trump did to turn off swing voters nonetheless complicated the path for Republicans who want to drive him out of the race or, at the least, cut him loose from the rest of the party’s ticket.

His aggressiveness gave him more control over the second debate than he had in the first, and his belligerence is precisely what his base loves about him. By the end of the encounter, he had done little to make the contest genuinely competitive, little to reassure Republicans who are thinking of jumping ship, but more than enough to rally his strongest supporters. They will remain an army of resistance to moves against him inside the GOP. This, too, may have been a victory for Clinton.

The most substantively shocking moment in the debate came early on. Speaking of Trump’s instability and untrustworthiness, Clinton said: “It’s just awfully good that someone with the temperament of Donald Trump is not in charge of the law in our country,” Clinton said.

Trump immediately shot back: “Because you’d be in jail.”

Nothing could have done more to reinforce fears of Trump as a dangerously authoritarian figure.

Friday’s video almost certainly ended any chance Trump has of becoming president. Clinton understood this and acted accordingly, believing that Trump would do her work for her. He largely did. Trump’s desire to fight back ferociously kept him in the race but left him badly wounded and made some of the wounds deeper. He was thus more dangerous to his party after the debate than he was before it began.

For Americans looking for uplift, the night offered very little. Clinton came the closest, opening and closing with an appeal to bring Americans together, and offering a grace note when both candidates were asked to praise something about their opponent. Clinton praised Trump for his children, and used it as a way of reintroducing her theme of a more united and tolerant nation. Trump praised Clinton for the very trait she most values in herself: her ability to stand up, fight and remain in the arena.

But that was about the only inspiration there was to be had. This is a vicious campaign that will for years make it hard for lovers of the American political system to proclaim that ours is the greatest democracy in the world. Trump rose to fame as a reality television star, and his quest for the presidency has brought everything that is offensive and dispiriting about the genre into the center of U.S. politics. It will take us a long time to recover.

Read more from E.J. Dionne’s archive, follow him on Twitter or subscribe to his updates on Facebook.