WASHINGTON — Donald Trump says he’s “greatly honored” to receive the endorsement of defeated rival Ted Cruz, not that Cruz is using that word when acknowledging that he will vote for the Republican presidential nominee.

Cruz and Trump had traded harsh words during the primary race and the tones of their statements Friday reflected their differences. Cruz sounded resigned at the prospect of voting for the man he had called a “pathological liar” and “utterly amoral” while Trump appeared to relish gaining the public support of the opponent he derided as “Lyin’ Ted.”

Nonetheless, Cruz’s statement signaled an effort to help unite a divided GOP less than seven weeks before Election Day. He also might be seeking to placate those he angered when he encouraged Republicans to “vote your conscience” instead of endorsing Trump outright at the 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 on Facebook.

Trump described the statement as an “endorsement,” although he had claimed immediately after the convention that he didn’t want it.

“I am greatly honored by the endorsement of Sen. Cruz,” Trump said. “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 Cruz statement comes as Trump and Democrat Hillary Clinton remain locked in a tight race, both struggling to unite their parties as their first debate looms Monday and early voting is underway in some states.

Trump has been branded as a phony by hard-line conservatives, Cruz among them, who see him more as a political opportunist than a true Republican.

“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 of Trump in May, hours before ending his campaign.

“Donald will betray his supporters on every issue,” the Texas senator added, while calling Trump “utterly amoral,” ”a narcissist,” ”a bully” and “a serial philanderer,” among other things.

Clinton addressed the shift on social media by posting a tweet from Cruz himself calling on Trump to release his tax returns. The Texas senator released nine years of his returns, while Trump has refused to release any.

Her running mate, Virginia Sen. Tim Kaine took his own dig at Cruz, saying as he campaigned in Texas, “If somebody said that about my dad, they would never have me as a supporter for anything.”

In his Facebook statement, Cruz cited two reasons for his shift: his pledge to support the party nominee and his disdain for Clinton. But he also faced intensifying political pressure from all quarters. Since the convention speech, polls have suggested that Cruz’s popularity was slipping nationally and in Texas — where he could face a primary challenger for re-election in 2018.

His base supported his refusal to back Trump at first, but the mood shifted recently. The vast majority of calls coming into Cruz’s office had turned increasingly negative in recent weeks with many voters urging him to support Trump to prevent a Clinton victory, according to Republicans familiar with the situation. They spoke on the condition of anonymity because these were internal discussions.

At the same time, the large staff that worked on Cruz’s presidential bid pushed him not to endorse. Most refused to accept jobs with the Trump campaign when offered following Cruz’s departure from the primary campaign this spring. And as recently as this week, some warned they would not work for Cruz again if he officially endorsed Trump.

Cruz’s decision also comes as he weighs the prospect of a 2020 presidential bid, where Trump’s donors could play an important role. None are more important than the Mercer family, which backed a pro-Cruz political group this spring before becoming major Trump backers.

Trump’s naming of Cruz ally, Utah Sen. Mike Lee, in his updated list of potential Supreme Court picks announced Friday helped ease tensions between the two camps. Trump also backed Cruz’s position in a congressional squabble over internet regulation.

Weissert reported from Austin, Texas.

Follow Peoples on Twitter at https://twitter.com/sppeoples

What political news is the world searching for on Google and talking about on Twitter? Find out via AP’s Election Buzz interactive. http://elections.ap.org/buzz