LAS VEGAS — Former New York mayor Mike Bloomberg suffered a punishing welcome and Sen. Bernie Sanders was bludgeoned with criticism as an animated cast of rival candidates spent Wednesday’s presidential debate scrambling to stake their claims against the two rising contenders in the Democratic race.

The result was an urgent, two-hour free-for-all that sizzled with animosity. Candidates who mostly avoided political combat in the previous debates, including Sen. Elizabeth Warren (D-Mass.) and former South Bend, Ind., mayor Pete Buttigieg, came out swinging, each of them aiming to avoid elimination from the race. Contenders who had once respected time limits eagerly spoke over one another, posing questions directly to each other; former vice president Joe Biden, facing his own make-or-break moment, was among those who repeatedly interrupted with the phrase “Let me finish!”

Sanders (I-Vt.) was challenged on his electability and questioned on his health, the combativeness of his online supporters and the viability of his policy prescriptions. Bloomberg was hit for his political record, his alleged coarse descriptions of women, his extraordinary wealth and his contention that he is best positioned to defeat President Trump. The other candidates on the stage, who have attended each of the previous eight debate rounds, took advantage of their first opportunity to directly challenge the billionaire, who has spent more than $339 million of his own money on advertising to put his campaign in contention.

Sanders accused Bloomberg of supporting the “outrageous” policy of stop-and-frisk policing and accumulating more wealth than the poorest 120 million Americans, which he called “immoral.” Warren described Bloomberg as “a billionaire who calls women fat broads and horse-faced lesbians,” a reference to quotes attributed to him in a booklet written by a former employee, which Bloomberg disputes. Buttigieg accused Bloomberg of trying to “buy this party out.” Biden called Bloomberg’s stop-and-frisk policy “abhorrent” and said the Obama administration had to intervene.

Warren, taking the tone of a prosecutor, challenged Bloomberg to release women who worked at his firm from nondisclosure agreements signed as part of harassment settlements, and she suggested his response to criticism about how he treated women in the workplace amounted to him saying “I treated some women well.”

“We’re not going to end these agreements because they were made consensually,” Bloomberg said, to boos from the crowd.

Bloomberg, who often stood steely-faced with both hands gripping the lectern, responded by declaring that if Sanders was the nominee, Trump’s reelection would be guaranteed, not solely because his Medicare-for-all plan would remove private health insurance for 160 million Americans. Bloomberg had previously said that he would spend substantially to help Sanders defeat Trump if the senator wins the Democratic nomination.

“I think we have two questions to face tonight. One is, who can beat Donald Trump? And number two, who can do the job if they get into the White House?” Bloomberg said. “And I would argue that I am the candidate that can do exactly both of those things.”

The debate came at a pivotal point in the campaign, three days before the third contest of the year, Saturday’s Nevada caucuses.

The debate was the first in which Sanders was the clear front-runner in the race, having jumped to the top of national polls and forcing many in the party to grapple with the idea that he is in the best position to take a large delegate lead in coming weeks. But he has often been an afterthought in debates, with other candidates more focused on which moderate is the best to take on Sanders than actually challenging Sanders.

As Sanders has soared, longtime leader Biden has plummeted, and Warren has struggled to regain ground. Buttigieg and Sen. Amy Klobuchar (D-Minn.) have sought to build national campaigns after surprisingly strong finishes in Iowa and New Hampshire. For several of the candidates, a weak showing in Saturday’s vote or the South Carolina primary on Feb. 29 could be dire.

Bloomberg has made his presence felt not at the polls — his name will not be on a ballot until the Super Tuesday primaries on March 3 — but with his outsize advertising presence.

Yet onstage, he struggled, rolling his eyes when he was scrutinized and finding it difficult to work his way into exchanges.

“What am I, chicken liver?” he said at one point, voicing frustration over his inability to get time to speak.

Bloomberg campaign manager Kevin Sheekey released a statement after the debate saying that his candidate would do better in next week’s debate.

“It took him just 45 minutes in his first debate in 10 years to get his legs on the stage,” Sheekey said. “He was just warming up tonight. We fully expect Mike will continue to build on tonight’s performance.”

The remade debate stage unleashed tensions over the role of money in politics, each candidate’s loyalty to the party and the lack of transparency on medical records and tax returns.

Sanders said he would not release additional medical records as he once promised, while Bloomberg insisted his tax returns would be made public in a few weeks.

"It just takes us a long time," Bloomberg said, saying that his tax returns are too lengthy to release quickly and that he couldn't merely go to TurboTax.

"Pay overtime," Warren said. "And get it done."

Warren came to the debate with more fire; even her allies found her last debate performance disappointing. She had barbs for everyone, accusing Biden of being too cozy with Sen. Mitch McConnell (R-Ky.) and ridiculing Buttigieg's health-care plan as being concocted by consultants.

“It’s not a plan; it’s a PowerPoint,” Warren said. She then turned to Klobuchar and dismissed her plan as “a Post-it note.”

Later, she accused Klobuchar of having small ideas. Her performance got results: About an hour into the debate, Warren’s campaign said it had its best hour of fundraising to date.

Warren rose to national prominence with her searing questioning of witnesses, first on a congressional panel overseeing federal bailout money and later in the Senate. She showed that side for the first time on the campaign trail, pressing Bloomberg repeatedly on why he would not release women from their nondisclosure agreements and demanding to know how many his company has signed.

The agreements, Warren said, will be used by the Republicans to attack Bloomberg, prompting a “drip, drip, drip” of damaging information. “We can’t just substitute one arrogant billionaire for another,” she said at one point, comparing the former mayor to Trump.

Buttigieg built on arguments he has been making for the past week, suggesting that voters “could wake up two weeks from now” having to choose “between a socialist who thinks that capitalism is the root of all evil and a billionaire who thinks that money ought to be the root of all power.”

He said Sanders hasn’t been fully transparent about how he will fund Medicare-for-all. He argued that Sanders’s approach excludes too many people to beat Trump in November. And he criticized Sanders for not condemning the rhetoric of his more boisterous supporters.

“At a certain point, you’ve got to ask yourself: Why did this pattern arise?” Buttigieg said to Sanders. “Leadership is about what you draw out of people. It’s about how you inspire people to act.”

Sanders responded by suggesting that Russian interference could be responsible for some of the online vitriol.

“We have over 10.6 million people on Twitter, and 99.9 percent of them are decent human beings, are working people, are people who believe in justice, compassion and love,” he said. “And if there are a few people who make ugly remarks … I disown those people. They are not part of our movement.”

When the conversation turned to whether Americans should be allowed to become billionaires, Sanders offered a lengthy plea for solutions to income inequality — including putting workers on corporate boards. At one point, a moderator asked Bloomberg if he should be allowed to “exist.”

Bloomberg offered the dispassionate case for his campaign: “I can’t think of a way that would make it easier for Donald Trump to get reelected than listening to this conversation.”

Bloomberg also challenged Sanders on his own wealth and real estate holdings. “The best-known socialist in the country happens to be a millionaire with three houses. What did I miss here?” Bloomberg said.

Sanders, raising his voice, said he had a home in Washington and in Burlington, Vt. “And like thousands of other Vermonters, I do have a summer camp! Forgive me for that,” he said.

As in previous debates, Buttigieg and Klobuchar did little to hide their disdain for each other.

Buttigieg repeatedly attacked Klobuchar for her voting record and campaign performance. Klobuchar, who rode a breakout debate performance in New Hampshire to a surprising third-place finish in the first-in-the-nation primary state, was asked to address the fact that she could not name the president of Mexico at an event last week.

“I don’t think that that moment, that momentary forgetfulness, actually reflects what I know about Mexico. And how much I care about it,” Klobuchar said.

Buttigieg seized on that moment to make an argument he has made against Klobuchar in their many heated exchanges in previous debates: He suggested her Washington experience has not prepared her for the presidency as well as she says it has.

“Are you trying to say that I’m dumb, or are you mocking me here?” Klobuchar asked, visibly upset. Later she shot back, sarcastically, “I wish everyone was as perfect as you, Pete.”

Eventually, Warren ended the discussion for them.

"I understand that she forgot a name," Warren said. "It happens. It happens to everyone on this stage."

During the exchange, Biden attempted to interject. "I'm the only one who knows this man. And met with him. C'mon, man!"

"Can I get a chance to say something?" he asked again, eventually getting to tick off his experience and his knowledge of world leaders.

Biden, who had squabbled with Bloomberg in the lead-up to the debate over who has the right to claim the legacy of Barack Obama, grew most animated over Bloomberg's stop-and-frisk policy that targeted young black men in New York.

"It's not whether he apologized or not. It's the policy," Biden said. "The policy was abhorrent and a violation of every right people have."

"I've sat," Bloomberg said. "I've apologized. I've asked for forgiveness."

But then, he said, everyone onstage had a problem in their past.

"If we took off everybody that was wrong on this off this panel, everybody that was wrong on criminal justice at some time in their careers, there'd be nobody else up here," he said, as several candidates shook their heads.