PHOTO: SAUL LOEB/ROBYN BECK/AFP/Getty Images
Now playing
00:59
Ted Cruz: I will vote for Donald Trump
kellyanne conway steve bannon hire sot newday_00005207.jpg
kellyanne conway steve bannon hire sot newday_00005207.jpg
PHOTO: CNN
Now playing
01:40
Conway won't say If Trump apologized to Cruz
PHOTO: SAUL LOEB/ROBYN BECK/AFP/Getty Images
Now playing
00:59
Ted Cruz: I will vote for Donald Trump
PHOTO: Getty Images
Now playing
05:05
What's behind Ted Cruz's endorsement of Trump?
Now playing
02:52
Donald Trump renews rivalry with Ted Cruz
rnc convention ted cruz booed _00001420.jpg
rnc convention ted cruz booed _00001420.jpg
PHOTO: CNN
Now playing
01:03
Ted Cruz booed by Republican National Convention crowd
Sen. Ted Cruz is expected to speak at the Texas delegation breakfast event at Marriot Key Center in Cleveland, OH at 8:45aET.
Sen. Ted Cruz is expected to speak at the Texas delegation breakfast event at Marriot Key Center in Cleveland, OH at 8:45aET.
PHOTO: cnn
Now playing
01:51
Cruz: I won't support those who attack my wife
Trump Heidi Cruz Melania JFK response _00000203.jpg
Trump Heidi Cruz Melania JFK response _00000203.jpg
PHOTO: CNN
Now playing
04:28
Trump: Heidi the best thing Cruz has got going for him
Trump Cruz JFK response_00013225.jpg
Trump Cruz JFK response_00013225.jpg
PHOTO: CNN
Now playing
01:33
Trump doubles down on denial of linking Cruz's dad to JFK assassination
Republican presidential candidate Donald Trump delivers a foreign policy speech at the Mayflower Hotel April 27, 2016 in Washington, DC.
Donald Trump pledged Wednesday to pursue an "American First" foreign policy if elected president, demanding that allies contribute more to global security. "America First will be the major and overriding theme of my administration," he said in a speech outlining his foreign policy.
 / AFP / Brendan Smialowski        (Photo credit should read BRENDAN SMIALOWSKI/AFP/Getty Images)
Republican presidential candidate Donald Trump delivers a foreign policy speech at the Mayflower Hotel April 27, 2016 in Washington, DC. Donald Trump pledged Wednesday to pursue an "American First" foreign policy if elected president, demanding that allies contribute more to global security. "America First will be the major and overriding theme of my administration," he said in a speech outlining his foreign policy. / AFP / Brendan Smialowski (Photo credit should read BRENDAN SMIALOWSKI/AFP/Getty Images)
PHOTO: BRENDAN SMIALOWSKI/AFP/AFP/Getty Images
Now playing
01:29
Donald Trump implies Rafael Cruz knew JFK assassin
rnc convention chris christie ted cruz selfish dana bash sot_00000419.jpg
rnc convention chris christie ted cruz selfish dana bash sot_00000419.jpg
Now playing
01:24
Christie: Ted Cruz's RNC speech was 'awful, selfish'
rnc convention michael cohen ted cruz political suicide sot_00000903.jpg
rnc convention michael cohen ted cruz political suicide sot_00000903.jpg
Now playing
01:07
Trump lawyer: Ted Cruz committed 'political suicide'
PHOTO: CNN
Now playing
03:34
Trump Jr.: We don't need Cruz's endorsement
what it was like on the floor when the rnc turned on ted cruz origwx allee_00003308.jpg
what it was like on the floor when the rnc turned on ted cruz origwx allee_00003308.jpg
Now playing
01:20
The view from the floor when the RNC turned on Ted Cruz
US Senator Ted Cruz of Texas speaks on the third day of the Republican National Convention in Cleveland, Ohio, on July 20, 2016.
US Senator Ted Cruz of Texas speaks on the third day of the Republican National Convention in Cleveland, Ohio, on July 20, 2016.
PHOTO: TIMOTHY A. CLARY/AFP/Getty Images
Now playing
01:30
Wednesday fireworks at the RNC in 90 seconds
PHOTO: Gray DC
Now playing
01:07
Ted Cruz talks about his RNC speech
Republican presidential candidate, businessman Donald Trump, second from left, gestures as Sen. Marco Rubio, R-Fla., Sen. Ted Cruz, R-Texas, and Ohio Gov. John Kasich watch him a Republican presidential primary debate at Fox Theatre, Thursday, March 3, 2016, in Detroit
Republican presidential candidate, businessman Donald Trump, second from left, gestures as Sen. Marco Rubio, R-Fla., Sen. Ted Cruz, R-Texas, and Ohio Gov. John Kasich watch him a Republican presidential primary debate at Fox Theatre, Thursday, March 3, 2016, in Detroit
PHOTO: Paul Sancya/AP
Now playing
01:14
Watch Ted Cruz pledge to support GOP nominee at debate
PHOTO: CNN
Now playing
02:10
Undecided voters confused by Ted Cruz speech
Ted Cruz Donald Trump plane arrival_00000320.jpg
Ted Cruz Donald Trump plane arrival_00000320.jpg
Now playing
00:55
Trump's plane interrupts Ted Cruz
HAMMONTON, NJ  - MARCH 29:  New Jersey Governor Chris Christie speaks at a Reform Agenda Town Hall meeting at the New Jersey Manufacturers Company facility March 29, 2011 in Hammonton, New Jersey. A State Supreme Court appointed judge ruled on March 22, 2011 that his eight percent education budget cuts last year had violated New Jersey law because the state was unable to fulfil it
HAMMONTON, NJ - MARCH 29: New Jersey Governor Chris Christie speaks at a Reform Agenda Town Hall meeting at the New Jersey Manufacturers Company facility March 29, 2011 in Hammonton, New Jersey. A State Supreme Court appointed judge ruled on March 22, 2011 that his eight percent education budget cuts last year had violated New Jersey law because the state was unable to fulfil it's educational obligations. (Photo by Jessica Kourkounis/Getty Images)
PHOTO: Getty Images
Now playing
05:04
Christie to Cruz: Keep your word, endorse Trump
ted cruz donald trump pathological liar sot ath_00000000.jpg
ted cruz donald trump pathological liar sot ath_00000000.jpg
PHOTO: CNN
Now playing
04:28
Ted Cruz: Donald Trump is a 'pathological liar'
PHOTO: SAUL LOEB/ROBYN BECK/AFP/Getty Images
Now playing
11:50
Ted Cruz's entire Donald Trump rant
ted cruz heckler donald trump supporter exchange bts_00002812.jpg
ted cruz heckler donald trump supporter exchange bts_00002812.jpg
Now playing
01:34
Cruz and Trump supporters get in heated exchange
Republican presidential candidate Donald Trump speaks to guests and supporters during a rally at the Indiana State Fairgrounds on April 20, 2016 in Indianapolis, Indiana.
Republican presidential candidate Donald Trump speaks to guests and supporters during a rally at the Indiana State Fairgrounds on April 20, 2016 in Indianapolis, Indiana.
PHOTO: Scott Olson/Getty Images
Now playing
04:18
Trump, Cruz spar over transgender bathrooms
PHOTO: Getty Images
Now playing
00:51
Ted Cruz: Trump's campaign can't run a lemonade stand
PHOTO: AFP/Getty Images
Now playing
01:06
Trump aide: Ted Cruz using 'Gestapo tactics'
Ted Cruz supporters are gathering in Milwaukee, WI to watch tonight
Ted Cruz supporters are gathering in Milwaukee, WI to watch tonight's results come in. Cruz is expected to address the crowd sometime after 9pET. We will update when a better ETA is available.
PHOTO: CNN
Now playing
03:53
Cruz plans to block Trump at convention
PHOTO: Getty Images
Now playing
04:33
Trump camp looking for a reboot before New York primary
PHOTO: SAUL LOEB/ROBYN BECK/AFP/Getty Images
Now playing
03:57
Cruz, Trump make mad dash for delegates
ted cruz campaign new york values roth dnt ac_00002106.jpg
ted cruz campaign new york values roth dnt ac_00002106.jpg
PHOTO: New York Daily News
Now playing
02:24
New Yorkers on Ted Cruz and 'New York values'
Republican presidential candidate Donald Trump speaks to guests during a campaign stop at Memorial High School on April 2, 2016 in Eau Claire, Wisconsin. Wisconsin voters go to the polls for the state
Republican presidential candidate Donald Trump speaks to guests during a campaign stop at Memorial High School on April 2, 2016 in Eau Claire, Wisconsin. Wisconsin voters go to the polls for the state's primary on April 5.
PHOTO: Scott Olson/Getty Images
Now playing
03:57
Trump, Cruz look ahead to New York
PHOTO: AFP/Getty Images
Now playing
02:35
Wisconsin primary could be tipping point in GOP race
PHOTO: AFP/Getty Images
Now playing
02:27
Donald Trump: John Kasich hurting me more than Ted Cruz
Donald Trump (L), chairman and president of The Trump Organization, speaks during a discussion at the Economic Club of Washington, December 15, 2014 in Washington, DC.
Donald Trump (L), chairman and president of The Trump Organization, speaks during a discussion at the Economic Club of Washington, December 15, 2014 in Washington, DC.
PHOTO: Mark Wilson/Getty Images
Now playing
01:24
Donald Trump: Heidi Cruz retweet was a mistake
wisconsin gop town hall donald trump ted cruz wife photo 06_00010607.jpg
wisconsin gop town hall donald trump ted cruz wife photo 06_00010607.jpg
Now playing
01:20
Donald Trump on Heidi Cruz photo: 'I didn't start it'

Story highlights

Ted Cruz backed his bitter primary rival via Facebook

Cruz and Trump traded personal insults throughout the campaign

Mike Pence was instrumental in bringing Cruz into the fold

(CNN) —  

Ted Cruz endorsed Donald Trump for the presidency Friday afternoon, a stunning turn of events after a contentious primary filled with nasty personal attacks and a dramatic snub at the Republican National Convention.

“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.

“A year ago, I pledged to endorse the Republican nominee, and I am honoring that commitment. And if you don’t want to see a Hillary Clinton presidency, I encourage you to vote for him.”

“I am greatly honored by the endorsement of Senator Cruz,” Trump said in a statement obtained by CNN. “We have fought the battle and he was a tough and brilliant opponent. I look forward to working with him for many years to come in order to make America great again.”

The move – three days before Trump’s critical first debate with Clinton – comes as the Trump and Cruz camps have moved closer in recent weeks.

Trump’s vice presidential nominee Mike Pence played a key role in bringing Cruz into the fold. Pence and Cruz traded multiple messages, then spoke at length once on the phone and again in person, when Pence visited Capitol Hill a few weeks ago, a source close to Pence said.

Ted Cruz fast facts

Trump has hired key Cruz allies such as Kellyanne Conway as his campaign manager, and Jason Miller as a spokesman.

Wednesday, Trump’s campaign expressed support for a Cruz-backed, Internet-related proposal in government funding talks in the Senate.

Friday, Trump released a new list of conservative judges likely to appeal to the former Supreme Court clerk – including perhaps Cruz’s closest friend in Congress, Utah Sen. Mike Lee.

Cruz cited Trump’s pledges on the judiciary in his Facebook post. “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 (the late Antonin) Scalia,’ Cruz wrote. “For some time, I have been seeking greater specificity on this issue, and today the Trump campaign provided that, releasing a very strong list of potential Supreme Court nominees — including Sen. Mike Lee, who would make an extraordinary justice — and making an explicit commitment to nominate only from that list.”

A Cruz endorsement could be the last pillar to helping Trump shore up the support of conservatives who have remained reticent about supporting his campaign.

Trump has already gotten most Republicans and conservatives on board with his campaign – largely by reassuring them on the Supreme Court and on issues like the Second Amendment and abortion. But Cruz’s principled opposition to offering his support has given some conservatives high-profile cover.

Just as Cruz’s refusal to endorse Trump at the RNC fueled Democrats’ efforts to paint Trump as divisive even within his own party, Cruz’s endorsement will help undermine that narrative – suggesting to conservatives unsure about Trump that perhaps the brash billionaire has changed, and can be trusted to bring conservative change to Washington.

’Lyin’ Ted’ and ‘utterly amoral’

The move marks a dramatic turnaround from the personal insults Cruz and Trump traded during the previous year.

The two men clashed repeatedly during the primaries, as Trump taunted the senator with the nickname “Lyin’ Ted,” suggested Cruz wasn’t eligible to be president due to his Canadian birthplace, and even speculated that Cruz’s father was involved in the JFK assassination. Trump also said Cruz should “be careful” or he would “spill the beans on your wife,” and retweeted an unflattering picture of Heidi Cruz. Those tweets have not been deleted from Trump’s account.

On his last day of the GOP campaign – the Indiana primary in early May – Cruz let loose against Trump, calling the businessman a “serial philanderer,” “utterly amoral,” and “a narcissist at a level I don’t think this country’s ever seen.

At the RNC in Cleveland, Cruz gave a memorable speech espousing conservative values but ended without endorsing Trump, as Trump allies booed from the convention floor. “Don’t stay home in November,” Cruz said. “Stand and speak and vote your conscience.”

The next day, he defended the move by citing Trump’s attacks against his family.

“I’m not in the habit of supporting people who attack my wife and attack my father,” Cruz told members of the Texas delegation. “That pledge was not a blanket commitment that if you go and slander and attack Heidi that I’m going to nonetheless come as a servile puppy dog and say, ‘Thank you very much for maligning my wife and maligning my father.’”

After the convention, Trump said that he would not accept Cruz’s endorsement if he offered it.

“I don’t want his endorsement. If he gives it, I will not accept it, just so you understand. If he gives it I will – I will not accept. It won’t matter. Honestly he should’ve done it because nobody cares and he would’ve been in better shape for four years from now,” Trump said.

Facing Senate primary in 2018?

Cruz’s move may also be politically expedient. He faces a possible 2018 Senate primary challenge from Texas Rep. Michael McCaul, the chairman of the House Homeland Security Committee, who has increasingly made an issue of Cruz’s failure to endorse Trump.

Republican National Committee Chairman Reince Priebus has said Republicans who don’t back Trump could pay a price down the road. And Trump also floated the idea of setting up a super PAC to oppose Cruz if he decided to run for office again.

Clinton’s campaign, after Cruz’s message posted on Facebook, was happy to note a number of shots Cruz took at Trump during the primary, including when he called on the businessman to release his tax returns.

Clinton’s official twitter account retweeted a tweet Cruz sent during the primary that said, “I’ve released 9 years of tax returns. RT if you agree it’s time for Donald Trump to release his!”

Clinton’s campaign has been hounding Trump to release his taxes, arguing that he isn’t doing so because they show shady business deals and ties to Russia. Trump has said he would release his taxes after an IRS audit.

Clinton’s vice presidential nominee Tim Kaine, campaigning in Austin, Texas, Friday, said he couldn’t support someone who used the same language Trump did about Cruz’s father.

“I just can’t help but say this,” Kaine said. “Donald Trump suggested that Ted Cruz’s dad was involved in the JFK assassination. Now we know that that is false, but false isn’t, there’s not the right word to describe what that is. It is so outrageously false. And as far as I know Donald Trump has not retracted it. As far as I know he has not apologized for it. And so if somebody said that about my dad they would never have me as a supporter for anything.”

Radio host Steve Deace tweeted his disappointment, calling the move a mistake and speculating that Cruz backers may not all follow the senator.

“I think it’s the worst political miscalculation of my lifetime. I hope I am wrong. The people will decide that,” Deace tweeted.

CNN’s Jeremy Diamond, Tom LoBianco, Dan Merica, Betsy Klein, and Dan Berman contributed to this report.