David Jackson

USA TODAY

WASHINGTON — Despite many angry battles with Donald Trump, including attacks on his wife and father, Texas Sen. Ted Cruz announced Friday he will vote for the Republican presidential nominee anyway in order to deny the White House to Hillary Clinton.

"After many months of careful consideration, of prayer and searching my own conscience, I have decided that on Election Day, I will vote for the Republican nominee, Donald Trump," Cruz wrote on his Facebook page.

Cruz, who has described Trump as a "pathological liar," said that "even though I have had areas of significant disagreement with our nominee, by any measure Hillary Clinton is wholly unacceptable — that’s why I have always been #NeverHillary."

Trump, who once habitually referred to Cruz as "Lyin' Ted" and suggested that his father was somehow involved in President John F. Kennedy's assassination, said he was "honored" by his rival's endorsement.

"We have fought the battle and he was a tough and brilliant opponent," Trump said in a statement.

News of the Texas senator's announcement drew catcalls from some of his Republican supporters who continue to oppose Trump.

"I think it's the worst political miscalculation of my lifetime," Iowa talk show host Steve Deace tweeted in anticipation of Cruz's announcement. "I hope I am wrong. The people will decide that."

The announcement is the latest twist in a contentious relationship between Trump and Cruz, his closest competitor in the Republican nomination race. In a speech at the Republican convention in July, Cruz pointedly refused to endorse the GOP nominee, drawing boos from the pro-Trump crowd.

Trump: I should have let Cruz get 'ripped' off stage

During the campaign, Trump accused Cruz of constant lying and cited his lack of popularity among Senate Republicans. Since Cruz's convention speech, Trump has threatened to back a primary challenger to Cruz when he comes up for re-election in Texas in 2018.

The New York businessman also shared an unflattering image of Cruz's wife, Heidi, on social media and cited tabloid reports seeking to implicate father Rafael Cruz in the 1963 assassination of President Kennedy — items Cruz himself cited in explaining to supporters why he did not endorse Trump at the convention.

The two candidates got on well early in the campaign. But Trump began attacking Cruz as the Texas senator began to pass him in polls ahead of the first delegate contest, the Iowa caucuses.

Cruz, who argued that Trump has liberal "New York values" at odds with conservatism, defeated Trump in Iowa, but was unable to follow up that momentum. Succeeding Trump victories in New Hampshire and South Carolina put him on a path to ultimately winning the Republican nomination.

Two other former GOP presidential candidates, Ohio Gov. John Kasich and former Florida governor Jeb Bush, have refused to endorse Trump.

Cruz is said to be considering another presidential run in 2020, should Trump lose in November.

In his Facebook post, Cruz listed six reasons for preferring Trump over Clinton: Supreme Court appointments, rolling back President Obama's health care plan, energy policy, immigration, national security and Internet freedom.

"If Clinton wins, we know — with 100% certainty — that she would deliver on her left-wing promises, with devastating results for our country," Cruz wrote.

Democrats mocked Cruz's about-face on Trump.

"DiscrediTED," tweeted former Obama aide Dan Pfeiffer. Tweeted former presidential speechwriter Jon Favreau: "HumiliaTED."

Many Republicans, including those sympathetic to Cruz, expressed incredulity at Cruz's decision.

Atlanta-based radio talk show host Erick Erickson said a Cruz endorsement at this point "plays to the caricature that he is self-interested, not really principled. Hate it for him."

Fact check: Trump defends claim on Oswald and Cruz's father

After insulting tweet, Cruz tells Trump: Leave my wife 'the hell alone'