WAUKESHA, Wis. — It may have been an instant of quick thinking.

Or it may have been the product of thoughtful preparation.

But on Sunday night, Mitt Romney did something that he has rarely, if ever, done on the campaign trail: He seized on a disruption by protesters as a moment to cast his own campaign as taking the moral and ideological high ground and President Obama as engaging in “gutter” politics.

The exchange took place over a span of only three minutes at an outdoor rally attended by several thousand supporters. But it was a revealing moment that provided a glimpse of just one of the ways in which Romney’s campaign has begun to transform in the 36 hours since he tapped a young, rising GOP star — Rep. Paul Ryan (Wis.) — to serve as his running mate.

Romney, who addressed the crowd just after Ryan, took the podium at the Waukesha County Expo Center before one of the most fired-up crowds of his campaign. The sky was overcast, but attendees repeatedly interrupted the two with cheers, and those in the back of the crowd yelled whenever the Jumbotron broadcasting the event momentarily switched over to the Romney-Ryan logo instead of live video of the candidates.

Romney was just a few minutes into praising Ryan’s qualities as a leader when several protesters began to shout.

As the rest of the audience sought to drown them out with chants of “USA! USA! USA,” Romney paused for a few seconds, then went on praising Ryan.

“Now, I know when most people go to Washington, D.C., they go filled with ambition,” he said. “He had a different career in mind when he was thinking of running for office, and yet he decided that America needed to have someone . . .”

Romney paused as the yelling started up again, then continued: “. . . who would go to Washington not thinking about how he could beat up on other people and throw brick bats at them, but instead someone who would go there to make a real difference.”

At this, the shouting intensified. Police officers ushered away a gray-haired woman who was wearing a bright green shirt and yelling, “What about the workers who lost their jobs?”

“Loser!” one woman in the crowd yelled back, while others booed.

The confrontation died down for about a minute. Then, another protester closer to the stage began to shout.

This time, Romney paused for about half a minute as the audience again responded with, “USA! USA! USA!”

Finally, he addressed the protester: “You see, young man, this group here is respectful of other people’s rights to be heard.”

The audience erupted into cheers.

“And you want to find yourself a different place to be disruptive,” Romney continued, “because here, we believe in listening to people with dignity and respect.”

The crowd let out an even bigger, longer cheer as the protest quieted down.

Since tapping Ryan — a figure who has electrified the GOP base — Romney has sought to recast his campaign as one of ideas, battling against an Obama campaign that has gone negative in an effort to distract from the struggling economy.

On Sunday night, in remarks that appeared unscripted, Romney struck precisely that message, linking the protesters to the Obama campaign.

“Look, there’s no question but that if you follow the campaign of Barack Obama, he’s going to do everything in his power to make this the lowest, meanest negative campaign in history, and we’re not going to let that happen,” Romney said. “This is going to be a campaign about ideas about the future of America. This is a campaign about greatness, about America’s future for your children, for the world.”

The crowd roared, and Romney concluded by addressing Obama: “Mr. President, take your campaign out of the gutter. Let’s talk about the real issues that America faces.”

Without skipping a beat, he pivoted back into an explanation of his five-point economic plan.

The episode was one small example of how the campaign’s message as well as Romney’s skill on the stump appear to have changed with the addition of Ryan to the GOP ticket.