Republican leaders, already wary of having Donald Trump on the ballot in the November presidential election, demanded Tuesday that he put more distance between himself and racist groups, saying the party cannot show anything but contempt for the Ku Klux Klan.

House Speaker Paul D. Ryan, breaking his usual rule of refusing to comment on the presidential election, said the party’s presidential candidates can leave no room for questions.

“If a person wants to be the nominee of the Republican Party, there can be no evasion and no games. They must reject any group or cause that is built on bigotry. This party does not prey on people’s prejudices,” Mr. Ryan said at a press conference.

He made the comment after several confusing days for Mr. Trump, who seemed to stumble when asked whether he would denounce the Ku Klux Klan and former KKK leader David Duke, a white supremacist.

On Friday, he did renounce Mr. Duke’s endorsement, then on Sunday said he didn’t know Mr. Duke. Asked specifically on CNN whether he would denounce the KKK, Mr. Trump demurred, saying some “good” organizations were also being tarred and he didn’t want to reject them all.

On Monday, he explained that he was having trouble with his earpiece during the CNN interview and didn’t understand the question.

“You take a look at Twitter, almost immediately after on Twitter and Facebook they were disavowed again,” he said on ABC’s “Good Morning America” program. “I disavowed [them] every time I speak to somebody, virtually, and you know they just keep it going. They keep it going, and they said, ‘Oh, we never looked at your Twitter account; we never looked at Facebook.’ I said take a look at Facebook; it was totally disavowed.”

He went on to say he categorically rejects the support of all white supremacists.

“Of course I am. Of course I am,” he said. “I mean, there’s nobody that’s done so much for equality as I have. You take a look at Palm Beach, Florida — I built the Mar-a-Lago club — totally open to everybody. A club that, frankly, set a new standard in clubs and a new standard in Palm Beach.”

The KKK flap is the latest barb by Republican leaders worried that Mr. Trump will be their nominee. They fear his stances on the issues, question his commitment to conservative principles and fret that he would squander a winnable election.

Just as worrisome for Republicans is what Mr. Trump would mean for the party’s senators seeking re-election, with control of the upper chamber on the line.

Senate Majority Leader Mitch McConnell, Kentucky Republican, refused to speculate on that — though he added his voice to Mr. Ryan’s in saying the Republican Party rejects Mr. Duke and the KKK.

Mr. Ryan said he will support his party’s eventual nominee, but other members of Congress have said they cannot.

Sen. Ben Sasse, a Nebraska Republican elected in 2014, has announced that if Mr. Trump is his party’s nominee and Hillary Clinton is the Democratic candidate, he will search for a third option.

Rep. E. Scott Riggell, a Virginia Republican who is not seeking re-election this year, added his voice to that movement Tuesday. He called Mr. Trump a “bully.”

“My love for our country eclipses my loyalty to our party, and to live with a clear conscience I will not support a nominee so lacking in the judgement, temperament and character needed to be our nation’s commander-in-chief,” he said in an email blast. “Accordingly, if left with no alternative, I will not support Trump in the general election should he become our Republican nominee.”

Even as he sheds some supporters, Mr. Trump has added others. Two governors, one senator and four members of the House have announced their support for Mr. Trump in recent days, according to the tally at statistics website FiveThirtyEight.com.