HOUSTON — Joe Biden and Elizabeth Warren tore into one another’s plans and fended off attacks from rivals eager to join them at the head of the field of White House hopefuls during their first clash on the same stage.

The third Democratic debate at Texas Southern University in Houston on Thursday night marked a new phase for the crowded presidential primary, one where candidates find themselves under stepped-up pressure. Only the 10 candidates who met the Democratic Party’s new stricter eligibility rules were invited, and the desperation of several of them not to get sidelined going forward made for a spirited three hours.

“Are you forgetting what you said two minutes ago?” former Housing Secretary Julian Castro said to Biden in a heated exchange over healthcare. He was attacking the former vice president’s policy plan but also, seemingly, the 76-year-old front-runner’s mental fitness for office. “I can’t believe that you said two minutes ago that they had to buy in, and now saying you don’t have to buy in. You’re forgetting that.”

Others on the stage chastised Castro, who had mischaracterized Biden’s comments. The exchange underscored the high stakes of an evening during which candidates sparred over their visions and tried varying tactics to gain ground.

The candidates arrived in Houston with many of their campaigns frustrated by the resilience of Biden, who continues to enjoy solid front-runner standing in the polls despite several falters on the trail. Massachusetts Sen. Warren is the only candidate who over the summer has advanced into the top tier of the race with Biden and Vermont Sen. Bernie Sanders. Most of the others are floundering. The top-tier candidates took some hits, but none were severe, and the showdown seemed unlikely to dramatically alter the contours of the race.

Biden wasted no time launching into criticism of the Medicare for All plans championed by Warren and Sanders.

He pointed to the bill Sanders wrote that would create a single-payer healthcare system, and which Warren supports. “The senator says she is for Bernie,” Biden said. “I am for Barack. I think Obamacare worked.”

“It doesn’t cost 30 trillion dollars,” Biden said, comparing his vision of expanded Obamacare to the Medicare for all plans. “How are we going to pay for it? … The senator on my left has not indicated how she pays for it,” Biden said of Warren. Then he motioned to Sanders: “The senator has, in fact, come forward to say how he will pay for it, but it only gets him about halfway there.”

The progressive senators aggressively defended their plans for expanding government, arguing the cost to consumers is dramatically lower under their vision and that nobody gets left uncovered.

“We all owe a huge debt to Barack Obama, who fundamentally transformed healthcare in this country,” Warren said. “Now, the question is how can we best improve that? Those at the very top, the richest individuals, the biggest corporations, are going to pay more and middle class families are going to pay less. That is how this is going to work.”

Even as Warren and Sanders run close to even in the polls and compete for many of the same progressive voters, they were united for most of the night. They focused their energy on drawing a clear contrast with Biden, with Sanders powering through a case of hoarse voice to call out what he argued are Biden’s shortcomings. “We have had disastrous trade policies,” Sanders said, arguing the trade deals Biden championed put Americans out of work. “Joe and I strongly disagree on trade.”

Sanders targeted Biden again when the debate turned to foreign wars, with the Vermonter bringing up Biden’s vote to authorize the invasion of Iraq during the administration of George W. Bush. “The difference between you and me is I never believed what (Vice President Dick) Cheney and Bush said about Iraq,” Sanders said.

Biden said he regretted voting for that authorization and highlighted his work as vice president to bring the troops home. But Biden made a sharp departure from the foreign policy championed by the Obama White House by agreeing with his rivals that all American troops need to return from Afghanistan, even if no deal is struck with the Taliban.

“We don’t need those troops there,” he said. “ I would bring them home.”

Warren said the same.

As with earlier debates, this one reflected the broader clash in the party between the ideological left and the moderate approach championed by Biden and other candidates on the stage, including Minnesota Sen. Amy Klobuchar and South Bend, Ind., Mayor Pete Buttigieg.

Biden repeatedly referred to his service in the Obama administration, warning that his more radical rivals were threatening to undo the progress of that administration and promising voters he would restore the order that existed before President Donald Trump.

But Biden’s time in the White House did not always work to his advantage. He faced renewed questions over the record number of immigrants deported during the Obama administration.

Univision anchor Jorge Ramos asked Biden why Latino voters should trust him when he supported the construction of a border wall during his 2008 presidential run and asked whether the former vice president would admit that he and Obama made a mistake by deporting 3 million people.

“Comparing this president to the president we had is outrageous,” Biden said, noting that immigrants were not locked in cages and families were not separated during the Obama administration. “I’m proud to have served with him.”

Ramos pressed whether he believes they erred.

“The president did the best thing that was able to be done at the time,” Biden said. “I’m the vice president of the United States.”

Biden’s move to distance himself from the policy drew rebuke from Castro, who also served in the Obama White House.

“Every time something good about Barack Obama comes up, he says, ‘Oh I was there, I was there, I was there. That’s me too,’” Castro said of Biden. “And then every time somebody questions part of the administration that you were a voting part of, he says, ‘Well, that’s the president.’ He wants to take credit for Obama’s work but not have to answer any questions,” Castro said.

The debate grew emotional when it turned to gun control, as former Texas Rep. Beto O’Rourke didn’t flinch when asked if the government should confiscate the type of high-velocity rifles used in the mass shooting in the Texas cities of Odessa and El Paso, O’Rourke’s hometown. He told of meeting a woman who watched her daughter bleed to death following an attack with weapons so deadly that there were not enough ambulances available to transport her to a hospital.

“Hell yes, we’re going to take your AR-15, your AK-47,” O’Rourke said, bringing some of the biggest applause of the night.

The push for such a confiscation program would have been taboo for a Democratic presidential candidate only recently. But at the debate, O’Rourke’s passion drew praise from the other candidates, including from Biden, who cautioned that new gun control laws would require the assent of Congress.

O’Rourke was among several contenders on the stage intent on showing the millions watching that they are viable contenders and that this is not the three-way race suggested by national polling averages.

California Sen. Kamala Harris aimed to rebound off an uninspired performance in the last debate by speaking forcefully about the threat posed by Trump. Her campaign is struggling to build momentum despite several viral moments created by the senator, including during the first debate in June, when she admonished Biden for his record of undermining mandatory school busing. The Harris campaign has yet to turn any of those moments into sustained energy on the campaign trail.

On Thursday night, she avoided attacking other candidates and directed her fire at the president.

“Let’s focus on the end goal,” Harris said following the extended back and forth between other candidates over healthcare, a thorny issue for Harris, whose position on Medicare for All has shifted over the months. “If we don’t get Donald Trump out of office, he’s going to get rid of all of it.”

Harris was once again called on to explain her work as a prosecutor, with a moderator asking her why she did not then push for some of the reforms in the criminal justice system she now supports.

Harris defended her record of pushing for body cameras for police officers, diverting people arrested on minor charges away from jail and other actions. “Was I able to get enough done? Absolutely not,” said Harris, who announced a package of criminal-justice reforms this week, including ending bail and eliminating the death penalty.

Another of the party’s national stars struggling to gain traction despite some attention-grabbing moments, New Jersey Sen. Cory Booker, changed his tone from the last debate, when he pilloried Biden’s record on criminal justice reform. On Thursday night, Booker avoided direct conflict with other candidates.

So did some of the more moderate candidates at the debate, whose path to the nomination relies on Biden stumbling. They avoided attacking the former vice president, being careful not to repel supporters of his they hope to ultimately lure their way.

That included Buttigieg, who was in the backdrop for much of the evening.

“This reminds everybody of what they cannot stand about Washington, scoring points against each other, poking at each other, and telling each other that — my plan, your plan,” Buttigieg said when Castro accused Biden of contradicting himself onstage.

Even so, the mayor, a gay military veteran, has drawn a large and devoted following of white collar professionals and gay rights activists. He has raised considerably more campaign cash than most candidates in the race, positioning him well to compete into the winter.

The prospects for other candidates on the stage are less clear. Some may not make it past the next debate, in October. Already, five candidates have dropped out of the race, including a governor, a former governor, a senator and two congressmen. As their campaigns failed to catch fire, donor support dried up, and they couldn’t see a path to victory any longer.

One candidate who is not likely to disappear anytime soon is the one who entered the race deeper in obscurity than any of his rivals onstage Thursday. New York entrepreneur Andrew Yang’s social media savvy, unique policy plans (he wants government to give every American adult $1,000 per month) and quirky appeal have given his campaign durability that makes some of his better known competitors envious.

Yang, in fact, used his opening statement to announce he would use his campaign account to give 10 families $1,000 a month for a year to promote his “freedom dividend” plan.

Whether such spending is legal under campaign-finance law is questionable. But it was undeniable that the pledge caught yet more attention for Yang. It also seemed to catch his opponents off-guard.