Some Republicans in Congress could be at risk of losing seats, in part because of the party's controversial presidential candidate Donald Trump. These are some the Republicans who are feeling the "Trump effect" the most. (Deirdra O'Regan/The Washington Post)

Pass the Prilosec.

Rarely have so many nasty words had to be eaten by so many politicians in such a short time.

Former Texas governor Rick Perry had been early among Republicans in declaring that Donald Trump was unfit to be president, saying last July that his then-rival for the presidential nomination was a “barking carnival act” and a “cancer on conservatism.”

That was then.

On Thursday, Perry endorsed the GOP’s nominee-apparent — and even suggested he would be willing to be Trump’s running mate.

Speaker Paul Ryan has backed away from his pledge to support whoever becomes the nominee, saying he's "not ready" to endorse Republican presidential candidate Donald Trump. Other GOP heavyweights, including the Bushes, are also not giving endorsements. (Jenny Starrs/The Washington Post)

“He is not a perfect man. But what I do believe is that he loves this country and he will surround himself with capable, experienced people and he will listen to them,” Perry said.

He is far from the only one. When former Louisiana governor Bobby Jindal was still in the race last September, he had called Trump “dangerous” and “a narcissist and an egomaniac.” Now, Jindal has also endorsed Trump, though he acknowledged: “I’m not happy about it.”

“Donald Trump is a delusional narcissist and an orange-faced windbag. A speck of dirt is way more qualified to be president,” Sen. Rand Paul (R-Ky.) had said of the front-runner in January, during an appearance on Comedy Central’s “The Nightly Show With Larry Wilmore.”

But in April, after his own presidential hopes had been extinguished, Paul said he would support Trump if he were the party’s nominee.

There is one Republican who is thoroughly enjoying the whole awkward spectacle of it all.

“People that have said terrible things about me have been on the phone with me over the last two days saying, ‘We want to join the Trump team,’ ” Trump said in an interview Tuesday night, as the returns in Indiana were shutting down any hope his critics had of blocking his nomination.

“I actually said to a couple of them: ‘How can you possibly join? What can you say to join, after what you said about me?’ ” he recalled. “And they said: ‘Don’t even worry about it, Mr. Trump. I’ll be able to handle that.’ ”

“In other words,” Trump added, “they’re politicians.”

Backflipping, of course, is a political ritual at the end of pretty much every bitter primary fight, as failed candidates face pressure to regroup to defeat the other party’s nominee.

After dropping out of the race, New Jersey Gov. Chris Christie and retired neurosurgeon Ben Carson moved fairly quickly to support Trump, even before it was entirely clear that he would be the Republican standard-bearer.

For others, it has been more difficult.

“Because Trump is so outsized, he generated outsize criticism,” said former House speaker Newt Gingrich, who has not been among the celebrity billionaire’s detractors. “So as people get ready to eat crow, the helpings are bigger.”

There is also the suddenness of it all. Many Republicans had assumed the fight would go on, right into the party convention in July.

Instead, they are having to deal with what Dick Tuck, a defeated candidate for state senator in California, uttered in a famous line on election night in 1966: “The people have spoken — the bastards.”

The failed GOP presidential candidates all pledged last fall to support the nominee. At the time, the move was aimed at keeping Trump himself from breaking away and running as an independent if he did not win.

Some are now making an exception to that pledge where Trump is concerned.

Most vocal has been Sen. Lindsey O. Graham (R-S.C.), who said in a statement Friday that he “cannot in good conscience support Donald Trump because I do not believe he is a reliable Republican conservative nor has he displayed the judgment and temperament to serve as Commander in Chief.”

Former Florida governor Jeb Bush came to detest Trump during their primary battle. On Friday, Bush wrote on his Facebook page: “Donald Trump has not demonstrated that temperament or strength of character. He has not displayed a respect for the Constitution. And, he is not a consistent conservative. These are all reasons why I cannot support his candidacy.”

The final two opponents to give up in the race against Trump, Sen. Ted Cruz (R-Tex.) and Ohio Gov. John Kasich, have yet to issue statements of whether they will support the nominee.

For Republicans further down the ballot, the balance is a tricky one: How to avoid alienating Trump’s supporters, without being tied too closely to him?

Sen. Kelly Ayotte, facing what is expected to be a difficult reelection battle in New Hampshire, has said she would “support the nominee,” without endorsing him.

Whatever that means.

Other Republicans — including Sens. John McCain (Ariz.), Tom Cotton (Ark.) and Dan Sullivan (Alaska) — have also said they would support “the nominee,” while avoiding saying his name.

There is also a political calculation to treating Trump as the “Harry Potter” villain Lord Voldemort — whom the novel series’ characters refer to as He Who Must Not Be Named.

“There are people who don’t want to be on videotape at home endorsing ‘Trump,’ ” Gingrich said. “But that’s fine.”