It was a now familiar Trump maneuver, a combination of cajolement and threat that the president is likely to increasingly employ with Democrats like Mr. Donnelly because of the fractious relationship he has with his own party. The easy time Senate Republicans had passing a budget resolution Thursday night is not expected to be repeated when they take up a tax bill, and Mr. Trump will need every vote he can get.

For Mr. Donnelly, his hold on office already perilous, supporting a Republican tax bill is only the latest possibility he must consider in the delicate dance of running for another term next year in a state Mr. Trump carried by nearly 20 points. He needs Republicans in great numbers to cross over and vote for him, so being on the wrong side of Mr. Trump carries great risk. At the same time, he must not alienate his Democratic base, many of whom distrust any kind of relationship with the president.

After the president called him out, Mr. Donnelly tried to laugh it off in the moment, but did not find it funny. “This is something I have not experienced before,” he said in an interview in this suburb of Indianapolis.

“I actually told his folks, ‘You have one of the most unusual sales tactics I have ever seen. I said, ‘In my experience when you are trying to have someone like your product or buy your product, you’re usually nice to your customer.’”

More important, the ultimatum did little to get the president closer to winning Mr. Donnelly’s support. “I happen to be an Irish-American,” he said, adding, “Threatening me is like waving the red flag in front of the bull.”