Republican presidential candidate Carly Fiorina took on Trump and his comment regarding her "persona." Hear her other memorable moments from the second GOP debate. (CNN)

The Republican debate Wednesday night — a three-hour affair that veered from sophomoric insults to policy to late-night silliness — ended with an outsider candidate, former tech executive Carly Fiorina, challenging front-runner Donald Trump in a way few rivals have.

Fiorina, who hadn’t even been on the main stage for the August debate, jabbed Trump for his insults of her appearance and his record as a businessman. She pointed out that Trump had lost money in his famous Atlantic City casinos.

Still, Trump dominated the night’s conversation — with other candidates often asked to react to things he’d said.

He started the debate with an unusual flurry of insults.

See how candidates responded to Trump

Asked about his own character at the debate’s outset, Trump pivoted quickly — and without a clear reason — to jab Sen. Rand Paul (Ky.) “First of all, Rand Paul shouldn’t even be on this stage,” Trump said, because he was so low in the polls.

Paul responded by calling Trump sophomoric for insulting his opponents’ appearances.

Trump then seemed to prove him right.

“I never attacked him on his looks,” Trump said of Paul. “And believe me, there’s plenty of subject matter there.”

Trump also insulted a rival who wasn’t even onstage: former New York governor George Pataki, whose poll numbers are so low that he was relegated to the undercard debate. Trump said that Pataki — who has feuded with the front-runner for weeks — “couldn’t even be elected dog-catcher in New York.”

It appeared some of the candidates had come prepared to counterattack Trump.

Wisconsin Gov. Scott Walker, who has declined in polls as Trump has risen, spoke up with what seemed a scripted attack.

Donald Trump was put to the test Wednesday night in the second GOP debate, while Carly Fiorina emerged as the big winner of the night. From the debate stage to the media crush, go behind the scenes from the Ronald Reagan Presidential Library in Simi Valley, Calif. (Alice Li/The Washington Post)

“We don’t need an ‘apprentice’ in the White House. We have one right now,” Wisconsin Gov. Scott Walker said, referring to President Obama. He did not mention that, in Trump’s TV show “The Apprentice,” Trump is not the apprentice. He is the boss.

Trump responded with a jab — one of many he’s used on Walker — about his record in Wisconsin and his decline in polls in Iowa.

“In Wisconsin I went to number one, and you went down the tubes,” Trump said.

But with Fiorina, Trump’s sharp tone became blunted.

It was an exchange at the end of the first hour where Fiorina scored her first points against Trump. They sparred over one of Trump’s most infamous insults, in which he told a Rolling Stone reporter that people might not vote for her because of her face.

“I think women all over this country heard very clearly what Mr. Trump said,” she said, to sustained applause.

“I think she’s got a beautiful face, and I think she’s a beautiful woman,” Trump replied, to much less reaction.

Relegated to the lower tier debate just a month ago, Fiorina became a dominant figure in Wednesday night’s marquee event, drawing loud applause for her attacks on Trump and putting the front-runner on the defensive more than any candidate has so far.

She responded to Trump’s attack on her tenure as chief executive at Hewlett-Packard by attacking his. She said that Washington politicians had run up huge amounts of debt and pointed out that Trump had done so in some of his business ventures in Atlantic City.

“That is precisely the way you ran your companies. You ran up mountains of debt, as well as losses, using other people’s money,” Fiorina said. “Why should we trust you to manage the finances of this nation?

In addition to taking on Trump, Fiorina had some of the most memorable lines of the night.

She made the most emotional plea for Republicans to confront President Obama in an effort to strip federal funding from Planned Parenthood. In emotional tones, she recalled a scene from undercover videos that aimed to show Planned Parenthood taking advantage of abortions to harvest the body parts of the fetuses.

“While someone says, ‘We have to keep it alive to harvest its brain,’ ’’ she said, that should require an effort to force Obama to veto this funding bill. If not, she said, “Shame on us.”

Fiorina came in as the third of three outsider candidates in the race, trailing both Trump and retired neurosurgeon Ben Carson in the polls. Carson, for his part, remained rather reserved throughout the debate, refusing to take the moderators’ bait to argue with the others around him.

However, Carson did have one retort aimed at Trump. In the last minutes of the debate, moderator Jake Tapper asked Trump about earlier comments that linked childhood vaccinations to autism, in which Trump repeated assertions that have been largely rejected by mainstream science. In response, Trump seemed to repeat that assertion again.

“Just the other day, 2 years old, a beautiful child,” Trump said, describing an acquaintance’s child. “Went to have the vaccine, and two weeks later had a tremendous fever, got very, very sick, and now is autistic.”

Tapper turned to Carson, the pediatric neurosurgeon.

“He’s an okay doctor,” Carson quipped, repeating a put-down Trump had used against him several days ago. “But, you know, the fact of the matter is, we have extremely well-documented proof that there is no autism associated with vaccinations.”

Trump vs. Bush

While Trump seemed blunted by Fiorina, he was not reserved with the other candidates onstage, in particular, Jeb Bush. Bush and Trump bickered like teenagers at times, cutting one another off and shushing each other. The main dispute was about whether Trump had tried to buy his way into casino gambling in Florida: Bush said he’d rejected Trump, Trump said he hadn’t really been trying.

“You’ve got more energy, tonight,” Trump told Bush. “I like that.”

Trump and Bush — whose front-runner status Trump stole — also sparred over whether Trump would apologize to the former Florida governor’s wife. “Why don’t you to apologize to her,” Bush said, after a question about Trump’s reference to Bush’s wife, who was born in Mexico, as having influenced his policy on immigration.

“Well, I won’t do that because I did nothing wrong,” Trump said. “But I hear she’s a lovely woman.”

That moment led the debate — at least briefly — out of the realm of insult comedy and into the realm of policy. Bush said that he wanted to expand opportunities for illegal immigrants to achieve legal status, citing President Ronald Reagan as an example of a politician who had done so. That was followed by an argument between Bush and Trump over whether it was appropriate for Bush to have spoken Spanish in a televised interview.

Trump said this sent a bad signal about assimilation: “This is a country where we speak English, not Spanish.”

That brought the best moment of the night for Sen. Marco Rubio (Fla.), who described how his grandfather — an immigrant from Cuba — came to love America and conservatism, and pass both loves on to Rubio.

“He taught me that in Spanish. Because that was the language he was most comfortable in,” Rubio said. He said he viewed current-day immigrants in a similar way and spoke Spanish to reach them: “If they get their news in Spanish, I want them to hear that directly from me, not from a translator at Univision.”

Later, Trump pushed Bush into a defense of his brother, former president George W. Bush, by attacking his decision to go to war in Iraq.

“As it relates to my brother, there’s one thing I know for sure, he kept us safe,” Bush replied, asking Trump if he recalled the destruction of Sept. 11, 2001, and his brother’s iconic embrace of firefighters at Ground Zero in Lower Manhattan.

“I don’t know, do you feel safe right now?” Trump replied. “I don’t feel so safe.”

It was a sign that Trump — who had lost his role as the dominant player in the debate’s second hour — still has a striking ability to push politicians into places they’d rather not go. For Bush, that meant confronting the unpleasant side of his brother’s legacy: that those stirring moments at Ground Zero had led to unpopular wars overseas and continuing fear at home.

He also did it to Rubio, in response to a very muted, veiled criticism by Rubio of Trump’s foreign policy ideas.

Trump, still unhappy, said that Rubio has “the worst voting record there is” in the Senate. Then Rubio — in another example that Trump’s insults still work — was left, essentially, to admit he’d given up on the U.S. Senate after less than one term.

“I figured out very quickly that the political establishment in Washington, D.C., of both political parties, is completely out of touch with the people,” Rubio said. ‘That’s why I am missing votes, because I am leaving the Senate, I’m running for president.”

The last hour of the debate involved some questions submitted through social media, including legalized marijuana use, which morphed into an uncomfortable moment for Bush. “Forty years ago, I smoked marijuana. I admit,” said the former Florida governor, after Paul had called him out without naming him.

Paul, who opposes strict laws punishing marijuana users, used Bush’s case to illustrate how the law treats wealthy drug users differently: “Kids who have privilege like you do don’t go to jail. But the poor kids in the inner city still go to jail.”

That prompted a response from New Jersey Gov. Chris Christie, who — while urging compassion for young drug users — also said he would use federal power to override some states’ laws to allow some marijuana possession and use. “I am against the recreational use of marijuana,” Christie, saying that drug users’ families, employers and children are victims of the use.

Fiorina, making a point that drug use remains a problem, returned to poke fun at Bush: “The marijuana that kids are smoking today is not the same as the one that Jeb Bush smoked 40 years ago,” she said, saying it was more powerful.

Nuclear deal

Trump was less vocal during a phase of the debate that ranged over the nuclear deal with Iran — which Sen. Ted Cruz (Tex.) said should be ripped up, but Paul said ought to be enforced, since it hadn’t been stopped.

The field then moved to a question of Senate tactics: Should Republicans risk a government shutdown to force a confrontation in order to strip federal funding for Planned Parenthood, a provider of abortions reviled by conservatives?

“I would not be for shutting the government down, because I don’t think it’s going to work out,” said Ohio Gov. John Kasich, arguing that the cause was valuable, but the tactic wouldn’t work.

“We need to stop surrendering and start standing for our principles,” said Cruz, arguing that the cause was so valuable that the tactics were worth the risk. Cruz, of course, convinced Republicans to try a similar confrontational tactic to stop the President’s health-care law. The government did shut down, and Republicans did not succeed in getting what they wanted.

After that, host Jake Tapper turned the debate to a question about Kentucky county clerk Kim Davis, who was jailed for refusing to issue marriage licenses to same-sex couples.

Former Arkansas governor Mike Huckabee repeated his argument that the Supreme Court had reached outside its authority by legalizing same-sex marriage in the first place. “If the court can just make a decision, and we just all surrender to it,” that is judicial tyranny, Huckabee said. He then shushed Tapper, who had tried to stop him, by saying that he hadn’t been given much time to talk so far. Of Davis’s jailing, Huckabee said, “What else is it other than the criminalization of her faith?”

A crowded field

The debate, carried out in front of a jetliner that served as Air Force One for Reagan, was the largest of any primary debate in history. Just introducing all 11 candidates took a significant period of time, as several made attempts at humor. Huckabee drew a parallel to the ’80s TV show “The A Team.” “We even have our own Mr. T,” he said, meaning Trump, “who doesn’t mind saying about others, ‘You’re a fool.’ ” For his part, Rubio — who was mocked for lunging for a drink of water during a televised response to the State of the Union — held up a bottle. “I made sure I brought my own water,” he said.

The debate, at times, seemed to borrow a slogan from Christie’s own campaign: When it was over, there would be nothing left unsaid between them.

In the waning moments of the debate, it moved into strange territory. The candidates were asked what woman they would put on the $10 bill. Many of them did not name al woman from U.S. history: Huckabee named his wife. Carson named his mother. Trump named his daughter (although then said civil rights icon Rosa Parks might be better). Bush named Margaret Thatcher, the British prime minister. Kasich named Mother Theresa, a nun who was born in the Ottoman Empire and helped the needy in India.

Two exceptions: Walker named Clara Barton, the founder of the American Red Cross. And Christie named Abigail Adams, wife and partner of founding father John Adams.

The candidates were then asked to give themselves a Secret Service code name. It was a strange exercise in self-image: Christie called himself “True Heart,” and Walker called himself “Harley.” The best answers came from two candidates who had a moment to think about it: Bush joked that he’d use a battery name because he was so high-energy, in a jab at Trump.

Trump called himself “Humble,” a rare jab at himself.

The warm-up act

Before the three-hour main event, CNN also had an undercard debate.

That match’s most memorable performance came from Sen. Lyndsey O. Graham, who campaigned on a split personality: half gloom and war, half cornball humor. In an otherwise humorless foursome, Graham’s jokes were the night’s most repeated lines. In explaining his call for more bipartisan cooperation, for instance, he harked back to deals Reagan and Democrats struck over a drink: “That’s the first thing I’m gonna do as president. We’re gonna drink more.”

In explaining his position that more legal immigrants were needed to pay into the retirement system as baby boomers retire, Graham used a one-liner about a famous and infamous senator from his home state of South Carolina. “Strom Thurmond had four kids after he was 67. If you’re not willing to do that, maybe we need a better legal immigration system,” Graham said.

And, talking about his plan to allow some illegal immigrants a path to legal status: “You can stay, but you gotta learn our language. I don’t speak it very well, but look how long I’ve come.”

Graham also laid out his desire to fight the Islamic State with the most colorful language used in the debate so far. “We’re gonna kill every one of these bastards we can find,” he said.

But the other three had memorable moments, seeking to underline one facet of themselves in front of a national audience they may never have again. For Louisiana Gov. Bobby Jindal, the thing to underline was his hard-line challenge to Washington Republicans, who he said were caving in the face of Democratic pressure.

“I am tired of the ‘surrender caucus.’ I am angrier at the Republicans in D.C. than I am at the president,” Jindal said. He attempted to embarrass Graham — the only sitting senator on the stage — by asking him why Republicans in Congress didn’t try to eliminate the filibuster in order to block a nuclear deal with Iran. Graham responded, essentially, that this was not the only fight Republicans needed to plan for, and that mustering a override veto might be useful against Obama in the future.

For former senator Rick Santorum, the quality to highlight was his efforts to help blue-collar voters. He rejected the suggestion that the U.S. should not raise the federal minimum wage, saying a small increase would be valuable to workers. “How we gonna win, ladies and gentlemen, how we gonna win, if 90 percent of Americans don’t think we care at all?”

And former New York governor George Pataki sought to portray himself as a sober, legal-minded Republican centrist. He rejected the contention — from Santorum and Jindal — that Kentucky court clerk Kim Davis should have been allowed to refuse marriage licenses to same-sex couples. “If she’d worked for me, I would have fired her,” Pataki said. “There’s a place where religion supersedes the rules of law. It’s called Iran.”

All four of them were hoping to do what Fiorina did in the last undercard debate: stand out, and leave the others behind. The next debate is not until late October, and its host network — CNBC — has not said if there will even be an undercard debate. That is, if there are enough candidates left to hold one. In the month since the first undercard debate, in early August, one of its candidates has already given up the fight: former Texas governor Rick Perry, who exited the race last week.

Former Virginia governor Jim Gilmore didn’t make the cut for Wednesday’s undercard debate: He needed to average 1 percent in any three recent polls. He didn’t.

Trump on the undercard

The four low-polling candidates focused on two figures who are likely to dominate the discussion all night long: Trump and Reagan.

Pataki compared himself to Reagan, the Republican icon whose presidential library is the site of both debates.

“When I think of Ronald Reagan, I think of his tremendous smile. A smile that reflected his optimism, and his unending belief and faith in America and Americans,” Pataki said. “That’s exactly the type of leadership we need in Washington today. And that’s why I’m running for president of the United States.”

Afterward, in the first question lobbed at candidates, the moderators asked Jindal about his attacks on Trump, the Republican front-runner. Jindal was asked if he had broken Reagan’s famous “11th Commandment,” which was not to attack fellow Republicans.

“Let’s stop treating Donald Trump like a Republican,” Jindal said. “He’s not a conservative. . . . He believes in Donald Trump.”

Santorum promptly disagreed, saying attacks on Trump were a distraction.

“Personal attacks just please one person: Hillary Clinton,” Santorum said, meaning that the Democratic front-runner was benefitting from GOP infighting.

But that was not the end of questions about Trump: The debate hosts continued to press candidates about why Trump, a political neophyte, was beating all of them so badly.

“The first four questions are about Donald Trump,” Pataki said, exasperated.

“The fifth one is, too,” said co-host Hugh Hewitt. And he was right.