Mr. Graham — who worked with Mr. Flake on immigration and Mr. Corker on foreign policy — said he shared those “concerns about what the president says and how he behaves.” But cozying up is the better choice, he said.

“I’m going to try to stay in a position where I can have input to the president,” Mr. Graham, 62, said in a lengthy interview. “I can help him where I can, and he will call me up and pick my brain. Now, if you’re a United States senator, that’s a good place to find yourself.”

“He’s very popular in my state,” Mr. Graham continued. “When I help him, it helps me back home. And I think it probably helps him to be able to do business with an old rival who’s seen as a deal maker.”

To Republican critics of Mr. Trump, Mr. Graham is risking his reputation with such a calculus.

“Lindsey Graham knows better,” said Peter Wehner, who advised former President George W. Bush and is a contributing opinion writer for The New York Times. “Deep in his heart, he must know that Donald Trump is fundamentally unfit to be president, and he has to pretend that Trump is. And when you engage in a game like that, there’s often a cost to it.”

Mr. Graham is willing to take the risk. Twice in the last two weeks, he has been the president’s golf partner. (Mr. Trump is better, he says.) There have been one-on-one huddles in the Oval Office. And two days before the series of phone calls last week, Mr. Trump brought Mr. Graham along for a 15-minute helicopter flight from Joint Base Andrews in Maryland to the White House after a trip aboard Air Force One.