Democrats vying to take on President Donald Trump warned that acrimonious in-fighting between candidates could undermine efforts to win the election in November 2020.

Following the heated discussion about healthcare in the first 40 minutes of the Democratic Party's third presidential debate in Houston, several candidates stressed the importance of standing together, saying fighting one another would play into Trump's hands.

Moments after former Housing Secretary Julian Castro, 44, of Texas accused former Vice President Biden, 76, of forgetting what he had just said two minutes earlier, Indiana Mayor Pete Buttigieg called for civility.

"This is why presidential debates are becoming unwatchable," he said. "This reminds everybody of what they cannot stand about Washington. Scoring points against each other, poking at each other."

Castro was unbowed. "That's called an election. This is what we're here for, it's an election."

"A house divided cannot stand," said Klobuchar, quoting Civil War-era President Abraham Lincoln. "And that is not how we're going to win this."

'Altar of purity'

That sentiment was echoed by U.S. Senator Cory Booker of New Jersey, who said while they had differences on how to pay for and deliver healthcare, every person on stage believed in universal care.

"We cannot sacrifice progress on the altar of purity," he said.

Biden and U.S. Senators Elizabeth Warren and Senator Bernie Sanders — the leading contenders for the 2020 Democratic presidential nomination — earlier sparred over how to best expand healthcare coverage for Americans.

The divide among the candidates comes over the proposal known as Medicare for All, which would cover every American under a government health plan and essentially eliminate private insurance

After another wave of mass shootings, the candidates all agreed on increasing restrictions on firearms to address gun violence, the latest sign that Democrats have made gun control a top priority for the first time in a generation.

Gun control

Beto O'Rourke, the former congressman from El Paso whose hometown was the site of a racially motivated mass shooting that killed 22 people last month, minced no words when asked whether he was proposing confiscating assault-style rifles.

"Hell, yes, we're going to take your AR-15, your AK-47," he said in a moment that instantly went viral, describing those guns as weapons that belong on the battlefield, not in America.

His comments were picked up on Twitter and led to a heated exchange between O'Rourke and Republican Briscoe Cain.

In a sign of just how much the Democratic Party has shifted on gun control, the ensuing discussion focused on ideas once seen as political dynamite: gun buybacks, assault weapon bans and licensing requirements.

Booker, who has proposed a national licensing system, said he has seen the impact of everyday gun violence in Newark, where he lives in a largely minority and low-income community and where he was mayor.

"These mass shootings are tragedies, but the majority of the homicide victims come from neighborhoods like mine," he said.

Both Warren and Sanders blamed corruption and a Congress beholden to the gun industry for failing to pass meaningful gun reform like universal background checks. Biden touted his work in passing the original assault weapons ban decades ago, despite opposition from the National Rifle Association.

Senator Kamala Harris of California repeated her contention that Trump's divisive rhetoric had inspired the El Paso shooter, who apparently wrote an anti-immigrant screed before the attack.

"Obviously he didn't pull the trigger, but he's certainly been tweeting out the ammunition," she said of Trump.

During the first two debates, some candidates questioned former President Barack Obama's failure to include a public option as part of the Affordable Care Act and his mass deportations of illegal immigrants as a way of attacking Biden, Obama's vice president for eight years.

At Thursday's debate, however, candidates went out of their way to praise Obama, who remains the party's most popular figure.

"I want to credit President Obama for bringing us this far," Harris said of Obama's signature healthcare law. Castro said America "owed a debt of gratitude" to Obama for the Affordable Care Act, commonly known as Obamacare.

Warren, who wants to scrap Obamacare, nevertheless praised the former president for the advances he made in providing health insurance to millions of more Americans.