WASHINGTON — Senator Ben Sasse is the rare Republican who has never been shy about criticizing President Trump, once comparing him to the white supremacist David Duke.
An erudite author, professor and former university president with a doctorate in American history from Yale, Mr. Sasse was once viewed as a potential primary challenger to Mr. Trump.
Now the president has endorsed Mr. Sasse for re-election — a surprise move that rendered the usually outspoken Nebraska senator mum, and demonstrated yet again how much the Republican Party has become the party of Trump.
“Ben has my Complete and Total Endorsement!” the president exclaimed Tuesday night on Twitter, lauding Mr. Sasse as “great with our Vets, the Military, and your very important Second Amendment,” and “Strong on Crime and the Border.”
For Mr. Sasse, who has a habit of zipping through the Capitol while talking on his cellphone to avoid reporters, it was certainly an awkward moment. On Thursday, he was being ridiculed on Twitter after brushing off an NBC reporter who asked about the endorsement by saying, “I don’t have anything for you right now” — a remark his office later said was not directed to the reporter.
But his spokesman, James Wegmann, did speak up, saying the endorsement was unsolicited.
“Ben’s grateful for the president’s kind words,” Mr. Wegmann said. “They don’t always see eye to eye, but they’ve built a relationship where they work together when they agree and they wrestle hard when they don’t.”
Solicited or not, the tweet will effectively ensure re-election for Mr. Sasse, 47, who these days is more apt to criticize Mr. Trump’s policies than his personal behavior. He is being challenged in a primary by businessman Matt Innis, who is making the senator’s chilly relationship with the president a central theme of his campaign. The Trump tweet most likely neutralized the primary threat.
“Trump’s endorsement destroyed the anti-Sasse message,” said Jennifer Duffy, who analyzes Senate races for the nonpartisan Cook Political Report, which rates the Nebraska seat “solid Republican.”
For Mr. Trump, there is no downside. He wants to ensure that the Senate remains in Republican hands. And if Mr. Sasse wins his race, the president can do what he likes to do best: take credit.
“I think he believes Ben wants him to be successful,” said Senator Lindsey Graham, Republican of South Carolina, a formerly savage critic of Mr. Trump who has more recently become one of his closest friends in the Senate. “He’s been a reliable vote for most things that Trump wants, and personal differences are meaningless to the president, because he’s trying to win. He’s trying to build a coalition.”
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.
When he announced his re-election campaign in August, Mr. Sasse promoted his conservative record and his votes in favor of the president’s “really great judicial nominees.” Local newspapers were quick to note that it was his only mention of the president.
He has also lately been making headlines as the lone member of the Nebraska congressional delegation who is not an honorary chairman of the president’s re-election in that state.
Mr. Trump, for his part, has not always been so high on Mr. Sasse. During his presidential campaign in 2016, Mr. Trump, who is known to judge people on whether they look the part, had this to say about the lanky, youthful-looking Nebraska senator: “@BenSasse looks more like a gym rat than a U.S. Senator. How the hell did he ever get elected?”