Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Texas Sen. Ted Cruz, who during the Republican presidential primary called Donald Trump a “pathological liar,” endorsed his former rival on Friday in a lengthy statement explaining why he is now "honoring" his pledge to support the GOP nominee.

“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 in a Facebook post.

“Hillary Clinton is manifestly unfit to be president, and her policies would harm millions of Americans. And Donald Trump is the only thing standing in her way,” he added.

“I am greatly honored by the endorsement of Senator Cruz. We have fought the battle and he was a tough and brilliant opponent," Trump said in a statement.

Cruz was booed during the Republican National Convention in July when he urged attendees to “vote your conscience.” But after months of watching other Republicans, like Rick Perry, Scott Walker and Marco Rubio – all also once adamantly opposed to Trump -- acquiesce to his nomination, heads turned at Cruz’s persistent rejection of the party’s new standard-bearer.

The primary battle between the two became nasty as Cruz emerged as Trump’s top threat. The real estate mogul promoted false tabloid stories linking Cruz’s father to the assassination of President John F. Kennedy and retweeted an unflattering photo of the senator’s wife.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Lyin' Ted Cruz just used a picture of Melania from a G.Q. shoot in his ad. Be careful, Lyin' Ted, or I will spill the beans on your wife! — Donald J. Trump (@realDonaldTrump) March 23, 2016

It all culminated in a blistering press conference in May when Cruz went off on the then-GOP frontrunner.

“This man is a pathological liar. He doesn't know the difference between truth and lies. He lies practically every word that comes out of his mouth,” Cruz said.

He continued at that press conference by calling Trump “utterly amoral” and a “serial philanderer.” And he asserted that Trump is “a narcissist at a level I don’t think this country’s ever seen."

During the height of their primary battle, Trump branded Cruz “lyin’ Ted” and threatened to “spill the beans” on his wife.

Some aides to the senator told NBC News they were frustrated with their boss’ decision.

"It's mourning in America for conservatives," Cruz’s former campaign communications director Rick Tyler said. "We lost our leader today."

Multiple other sources close to Cruz lamented his choice to use the word “endorse” and argued that he could have simply announced he planned to vote for Trump.

As has been noted pointedly to me today by some ppl in Cruz's orbit: Trump STILL hasn't apologized for what he said re: Cruz's wife, father. — Hallie Jackson (@HallieJackson) September 23, 2016

Aides say Cruz’s decision was not impacted by Republican National Committee Chair Reince Priebus’ recent veiled threat of retribution for former candidates who pledged to support the nominee.

One source said Priebus’ comments “probably delayed it a week.”

In the statement on Friday, Cruz said Trump’s focus on policy differences with Clinton, most importantly in choosing the next Supreme Court justice, helped him change his mind.

“We know, without a doubt, that every Clinton appointee would be a left-wing ideologue. Trump, in contrast, has promised to appoint justices ‘in the mold of Scalia,’” Cruz wrote.

Earlier in the day, Trump released an expanded list of names from which he’d choose to nominate for potential Supreme Court justice vacancies. That list included Sen. Mike Lee, a Republican from Utah, who Cruz referred to as his “soul brother” this spring and often suggested would "look good in a robe.” A source told NBC News that the Texas senator had made a specific ask of the Trump campaign to make Lee part of that list.