Mr. Graham, who once called candidate Trump “the world’s biggest jackass” and a “race-baiting xenophobic religious bigot,” was reminded that Mr. Sasse had said some very nasty things about Mr. Trump. “No nastier than I did,” replied the senator, who is also up for re-election next year.

Mr. Sasse, first elected in 2014, refused to vote for Mr. Trump in the 2016 general election, and told Omaha reporters that he intended to write in the name of Mike Pence, now the vice president. It was during that campaign that he compared Mr. Trump to Mr. Duke, a former grand wizard of the Ku Klux Klan. But now that Mr. Trump occupies the Oval Office, the senator votes with him 85 percent of the time, according to the website FiveThirtyEight.

In the Senate, where he is prone to long-winded speeches on the Constitution and separation of powers, he has also been known to make appeals to decency and unity, as he did last year during the Supreme Court confirmation hearings of Brett M. Kavanaugh. When Mr. Trump mocked Christine Blasey Ford, who had accused Mr. Kavanaugh of sexually assaulting her when they were teenagers, Mr. Sasse railed against the president in an emotional speech on the Senate floor.

“We all know that the president cannot lead us through this time,” Mr. Sasse said then. “We know that he’s dispositionally unable to restrain his impulse to divide us. His mockery of Dr. Ford last night in Mississippi was wrong, but it doesn’t really surprise anyone. It’s who he is.”

But in the end, like almost every other Republican, Mr. Sasse voted to confirm Justice Kavanaugh.

The senator’s critics say that more recently, as his re-election has approached, he has muffled his attacks on the president, noting that he said little about Mr. Trump’s divisive language over the summer, when the nation was reeling from mass shootings in cities like Dayton and El Paso.

Sherrilyn Ifill, the president of the NAACP Legal Defense and Educational Fund, wrote on Twitter that Mr. Sasse had “preached unity” in a book he released last year titled “Them: Why We Hate Each Other — and How to Heal.” “His total silence during this entire summer when Trump dialed up division & racism & we faced El Paso was uniquely cynical in that context,” she added.

The senator, a frequent contributor to the opinion page of The Wall Street Journal, has been a vocal critic of Mr. Trump’s policies on tariffs and trade, which he has called “dumb” and potentially “disastrous.” On Thursday afternoon, he was headed to the White House with other Midwestern senators to meet with Mr. Trump on agricultural issues, said another attendee, Senator John Thune, Republican of South Dakota.