CLEVELAND — Conservatives continued to battle for the soul of the Republican Party at its national convention Wednesday, with Sen. Ted Cruz refusing to endorse nominee Donald Trump and instead delivering a speech that many in the crowd saw as the kickoff of the 2020 presidential campaign.

Boos rained down from the rafters of Quicken Loans Arena as Mr. Cruz walked off the stage after just a single mention of Mr. Trump.

The businessman later responded to the snub with a tweet, “Wow, Ted Cruz got booed off the stage, didn’t honor the pledge! I saw his speech two hours early but let him speak anyway. No big deal!”

VOTE NOW: Should Ted Cruz have endorsed Donald Trump in his convention speech?

Mr. Trump had entered the arena during Mr. Cruz’s remarks and took a seat with his family to listen to son Eric Trump, who said his father was running for all the right reasons.

“Vote for the candidate you know is running for the right reasons. Vote for the candidate who’s never been a politician. Vote for the candidate who’s never received a paycheck from our government,” the son said. “Frankly, vote for the one candidate who does not need this job.”

Indiana Gov. Mike Pence, the vice presidential nominee, called for unity behind Mr. Trump’s vision for the party, and several other erstwhile opponents from the Republican primary gave full-throated endorsements of Mr. Trump.

SEE ALSO: Newt Gingrich tells booing crowd they ‘misunderstood’ Ted Cruz

“The time for fighting each other is over. It’s time to come together and fight for a new direction for America,” said Sen. Marco Rubio, who suffered some of the harshest barbs from Mr. Trump during the primary, speaking by video.

Three days into the convention, unity remained elusive, though not for lack of effort from Mr. Trump’s backers, who said the holdout candidates who have refused to endorse the party’s nominee despite promising to do so during the campaign are hypocrites.

“We love you. But you must honor your pledge to support Donald Trump now. Tonight,” said talk radio host Laura Ingraham.

Former House Speaker Newt Gingrich tried to recast Mr. Cruz’s speech in a positive light, saying Mr. Cruz urged delegates to vote for candidates who will defend the Constitution.

“In this election, there is only one candidate who will uphold the Constitution,” Mr. Gingrich said.

Mr. Cruz mentioned Mr. Trump only once, congratulating him on winning the primary. The senator also endorsed building a border wall and striving for better trade deals.

But he put the burden on Mr. Trump to win over rank-and-file Republicans.

“We deserve leaders who stand for principle, unite us all behind shared values, cast aside anger for love,” he said in his prepared remarks. “To those listening, please, don’t stay home in November. Stand, and speak, and vote your conscience, vote for candidates up and down the ticket who you trust to defend our freedom and to be faithful to the Constitution.”

Hours earlier, at a rally on the outskirts of the convention, Mr. Cruz basked in his supporters’ chants of “2020” — the year of the next presidential election — and lamented falling short this year.

“We beat 15 of those candidates. We just didn’t beat 16,” Mr. Cruz said — at the very moment Mr. Trump’s plane was descending for a landing in the background.

“Wow. Cruz picks tonight to announce for president in 2020,” one Republican Party strategist said as Mr. Trump’s son Eric was speaking Wednesday night.

Many delegates and guests in the arena were enraged.

“What a jerk. He deserved to lose,” said Lori London, from North Carolina. “It’s disgraceful how he made it all about himself.”

“The goal was to unite the party. He can’t come in here and do a stump speech for four years from now,” said Denny Pavan, a farmer from Bay Village, Ohio.

Mrs. Clinton mocked the Republicans’ ongoing struggle for unity: “Neo-Nazis, white supremacists, and anti-Semites: three groups @realDonaldTrump is bringing together,” she said in a Twitter posting.

Her campaign pointed to the hefty list of criticisms Mr. Trump’s erstwhile opponents laid out during the primary campaign.

“A wise man once said, ‘Nominating Donald Trump would be an absolute trainwreck.’ That man was Ted Cruz,” the Clinton campaign said in a statement. “In a rather depressing turn of events, Cruz is now speaking at Donald Trump’s nomination. But on the bright side, he’s been proven totally right about the whole trainwreck thing.”

Mr. Cruz’s speech was the latest sign of chaos at the convention. Pundits have said they detected a lack of energy inside the arena, and the campaign has had some unforced errors.

The highlight Monday — the first major speech by Melania Trump, the candidate’s wife — turned into a three-day embarrassment after a chunk of her remarks echoed a 2008 speech by Michelle Obama. The campaign acknowledged Wednesday that the words were taken from the speech, sparking questions about whether anyone has the reins of the operation.

With only a day left in the convention, it was also clear that the party needs to work more on unity. A divisive fight over party rules Monday and a renewed effort to embarrass Republican leaders during the roll call vote to nominate Mr. Trump on Tuesday showed that the fault lines of the primary haven’t mended.

A striking number of Republicans refused to attend the convention. Some who did, including House Speaker Paul D. Ryan and Senate Majority Leader Mitch McConnell, offered only tepid support. Both men said the chief reason to back Mr. Trump was because he would sign congressional Republicans’ agenda into law.

The chief unifying factor for Republicans is his opponent in November, Mrs. Clinton. Wisconsin Gov. Scott Walker, one of Mr. Trump’s opponents and a fierce critic during the campaign, explicitly backed the nominee Wednesday, saying he was the clear choice over the former first lady.

“Last August, I said that any of the Republicans running would be better than Hillary Clinton. I meant it then, and I mean it now. So let me be clear: A vote for anyone other than Donald Trump in November is a vote for Hillary Clinton,” Mr. Walker said in his speech.

Mr. Trump’s brash style and withering insults aimed at his opponents during the campaign ensured a difficult healing process.

Florida Gov. Rick Scott, an early Trump backer, tried to soften the nominee’s rough edges, acknowledging he is not always polite and may speak too directly. But Mr. Scott said this election is about “the very survival of the American dream.”

“This year, we get to fire the politicians,” he said. “And who better to let the politicians know you’re fired than Donald Trump?”

At times since sewing up the nomination, Mr. Trump has hinted that he doesn’t care about earning his competitors’ backing.

Former Florida Gov. Jeb Bush and Ohio Gov. John Kasich have also withheld their endorsements from Mr. Trump.

Whether the holdouts’ strategy hurts them remains to be seen — but Mr. Cruz had some backers within the Texas delegation to the convention, which overwhelmingly backed their home-state senator during the primary.

“I love it,” said Dianne Williams, 71.

“He is a man if his principles, and he’s not going to move off it. That’s why we love him,” she said.

• S.A. Miller and David Sands contributed to this report.