Ted Cruz has endorsed Donald Trump in the race for the White House.

Defeated Republican presidential hopeful Ted Cruz has endorsed Donald Trump in the race for the White House.

The Texas senator fought Mr Trump in a bitter primary battle, marked by mud-slinging and personal insults.

Mr Cruz said he would fulfil his promise to vote for the Republican nominee and that electing Hillary Clinton would be "wholly unacceptable".

He drew ire at the Republican National Convention in July, when he was booed off stage for not endorsing Mr Trump.

"This election is unlike any other in our nation's history. Like many other voters, I have struggled to determine the right course of action in this general election," Mr Cruz announced in a Facebook post.

"After 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."

Everything Ted Cruz has said about Trump

The comments underscore a dramatic U-turn for Mr Cruz, who has referred to Mr Trump as a "trainwreck" and a "pathological liar" who could not be trusted in the White House.

Mr Trump responded to the Cruz reversal by saying he was "greatly honoured" to have the endorsement of "a tough and brilliant opponent".

But some of Cruz supporters decried the senator's announcement, including his former campaign spokesman, Rick Tyler, who told NBC: "It's mourning in America for conservatives. We lost our leader today."

Meanwhile, Trump campaign manager, Kellyanne Conway, who previously worked for a super PAC supporting Mr Cruz, expressed her relief on social media.