Months after their nasty GOP primary fight, Texas Sen. Ted Cruz on Friday officially announced that he will vote Donald Trump for president.

“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 Facebook on Friday afternoon.

Trump reacted to the news in a statement, saying: “I am greatly honored by the endorsement of Senator 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, who it is believed would like to run for president again, was booed in July during the Republican National Convention when he declined to endorse Trump. Instead, he told delegates to “vote your conscience, vote for candidates up and down the ticket whom you trust to defend our freedom and to be faithful to the Constitution.”

The contest between Cruz and Trump got particularly nasty towards the end: Trump routinely referred to his rival as “Lyin’ Ted.” Cruz famously referred to Trump as a “sniveling coward.”

[dcquiz] In a lengthy post explaining his decision, Cruz said that “like many other voters, I have struggled to determine the right course of action in this general election.”

“I’ve made this decision for two reasons,” Cruz wrote. “First, last year, I promised to support the Republican nominee. And I intend to keep my word. Second, 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.”

He added: “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.”

The Tea Party Patriots Citizens Fund, an organization that backed Cruz over Trump in the primary but endorsed Trump this week, said it “commends” Cruz for “listening to the grassroots activists and Republican voters who nominated Donald Trump in order to shake up the Washington Establishment and its stranglehold over our politics.”

“It is clear Ted Cruz has examined his principles, considered the choice at hand and has decided to lead by example in endorsing Donald Trump as the man who will repeal Obamacare, balance our budget, and ensure the Supreme Court protects our most cherished rights over Hillary Clinton, who will represent another four years of the failed Obama Administration,” said the group’s chairwoman, Jenny Beth Martin.

Follow Alex on Twitter