COUNCIL BLUFFS, Iowa — President Trump stepped up his attacks on Democrats on Tuesday night as he sought to paint them as the party of “unhinged” and “wacko” radicals who should not be trusted with control of Congress.

At a boisterous rally, Mr. Trump returned to the campaign trail for a victory lap after hosting a ceremonial swearing-in of Justice Brett M. Kavanaugh at the White House, and he made clear that he will use the confirmation fight as a rallying cry in the remaining weeks before the midterm elections. Supporters cheered exuberantly at the mention of Justice Kavanaugh’s name.

Pointing to the opposition to Justice Kavanaugh, who was accused of sexual misconduct by women who knew him in high school and college, Mr. Trump said that Democrats had become “totally unhinged,” and he cited a series of them by name as the audience booed. “The Democrats have become too extreme and, frankly, they’ve become too dangerous to govern,” he said. “They’ve gone wacko.”

The president’s evolving campaign stump speech is part of a concerted Republican effort in recent days to recast the protests over Justice Kavanaugh as the actions of an “angry left-wing mob.” In effect, Mr. Trump and his allies are trying to paint his opposition in the same light that he has been painted during his time on the national stage. A former aide recently wrote a kiss-and-tell book about Mr. Trump titled “Unhinged,” and others have privately questioned his mental stability.