Ted Cruz said Friday he’ll vote for Donald Trump in November, in a major turnaround for the Texas senator who heatedly clashed with the real-estate mogul during the Republican presidential primary.

In a post on his Facebook page, Cruz said he would vote for Trump “after many months of careful consideration.”

Cruz said he had made the decision for two reasons: his promise to support the Republican nominee and his belief that Democrat Hillary Clinton is “wholly unacceptable.”

Cruz to date had not only refused to endorse Trump but had taken his personal distaste for him to the audience at the Republican convention by saying, “Vote your conscience.” Trump earned Cruz’s ire by suggesting the senator’s father was linked with John F. Kennedy’s assassin and by threatening to “spill the beans” on Cruz’s wife, Heidi.

Cruz ended his own bid for the GOP nomination in May.

In announcing he will vote for Trump, Cruz said he was influenced by policy differences with Clinton including the Supreme Court. Earlier Friday, Trump said he would consider naming Sen. Mike Lee of Utah — a Cruz ally — to the high court. Cruz also said he disagrees with Clinton on Obamacare, energy policy and immigration.

Cruz faced immediate blowback for his decision, as can be seen on his Facebook page:

Twitter was awash in reminders of what Cruz and Trump have said about each other in the past.

The name of Rafael Cruz, the senator’s father, was also trending after the announcement and was the subject of some humorous tweets.

In a brief statement, Trump said: “I am greatly honored by the endorsement of Sen. Cruz. 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.”

Cruz plans to run for re-election in 2018. Rep. Michael McCaul, a Texas Republican who hasn’t ruled out challenging Cruz for his Senate seat, said this week that Cruz “broke his word” by declining to endorse Trump at the convention.