This post has been updated. 

MIAMI — Former presidential candidate Carly Fiorina endorsed Ted Cruz on Tuesday, urging Republicans to unify behind him to beat Donald Trump.

In a surprise appearance here, Fiorina said she voted for Cruz in the Virginia Republican primary last week.

"I walked into the ballot box and I looked at the ballot and I saw my own name on the ballot — it was kind of a thrill," she said.  "Then I checked the box for Ted Cruz."

Fiorina, who ended her campaign in February, painted Cruz as a fighter who would stand up to Washington and beat Hillary Clinton in a general election.

"In order to lead you must challenge the status quo and when you challenge the status quo, guess what? You do more than ruffle feathers. You make enemies," she said. "Ted Cruz is known, he is proud to be known, by the enemies he has made in the D.C. cartel."

Fiorina said Clinton and Trump are one and the same, people who have either made their living in the political establishment or attempted to buy their way into it. Jason Johnson, Cruz's chief strategist, said the process of getting Fiorina's endorsement happened within the past week.

Fiorina said there are Republicans who are "horrified" by Trump: "I'm one of them."

And the only way to beat Trump, she said, is at the ballot box.

"The only guy who can beat Donald Trump is Ted Cruz," she said.

Fiorina and Cruz have a common benefactor — Robert Mercer, a New York hedge fund magnate who poured $11 million into a super PAC supporting Cruz. Mercer also donated $500,000 to Fiorina's campaign.

Speaking to reporters here, Cruz praised Fiorina's business acumen, understanding of national security threats and conservative bona fides.

"She was the CEO of one of the most respected companies in the world and her campaign for president impressed people all over this country," Cruz said. It "impressed Republicans, it impressed independents, it impressed Democrats."