US involvement in wars abroad was the main foreign policy issue to come up in the debate held on Tuesday under the shadow of Trump's confrontation with Iran.
Domestic issues like health care for all, taxing the rich, income inequality and education took up most of the two-hour debate during which the candidates in the whittled down field of six made their cases for competence to be president and electability against Trump.
The debate was held in Des Moines in Iowa state, the first stop in the selection process for the Democratic nominee that is set for February 3.
One of the dramatic moments came when a report that Senator Bernie Sanders had told fellow-leftist candidate Elizabeth Warren that a woman can't be elected president was raised.
Sanders vehemently denied having said it, while Warren was equally adamant that he had told her so, making one of them untruthful.
Trump added to the drama while the debate was on in Des Moines by throwing his support behind Sanders during a rally in Milwaukee.
He told his supporters, "I don't believe Bernie said that, I really don't. It's not the kind of a thing he would say."
"A woman can win for president," he added.
Extolling the power of women candidates, Warren claimed that she was the only one on the stage to have defeated an incumbent Republican in an election in 30 years.
Sanders cut in to say that he had defeated a Republican incumbent in 1990, which is just short of 30 years.
Warren and Sanders are vying for support from the same base of left-leaning voters.
The only unifying factor for the six rivals was their disdain for Trump, whose every policy from Iran to healthcare they slammed.
Former Vice President Joe Biden's vote for the Iraq War came up and Sanders, who had opposed it, had a dig at him saying that they had both listened to former President George W. Bush and other leaders make the case for the Iraq invasion by claiming there were weapons of mass destruction there and while he thought they were lying, Biden "saw it differently."
Biden said, "I was mistaken and I acknowledge that."
All the candidates said that they were against going to war abroad, although Biden was against a quick, unilateral withdrawal from Iraq as it would empower the Islamic State, he said.
They all blamed Trump for the Iran crisis by his withdrawal from the international agreement with Teheran on containing its nuclear programme and starting a confrontation by killing Iranian Major General Qassim Soleimani in Iraq this month.
But they agreed that Iran should not be allowed to develop nuclear weapons and the best way to do this was through international cooperation.
On North Korea, Biden and the billionaire businessman Tom Steyer said that they would not meet that country's leader Kim Jong Un unconditionally as Trump has done.
Biden, who said that he would pressure China to stop North Korea's nuclear weapons programme, recalled that Kim had said, "Joe Biden is a rabid dog. He should be beaten to death with a stick."
While they agreed that Congressional approval should be required for going to war, Pete Buttigieg, the only one to have served in the Afghan War, said that he would put a three-year limit on the authorisation.
On the trade, the candidates said that the new deal negotiated with Canada and Mexico by the Trump administration was an improvement on the North American Free Trade Agreement signed by former President Bill Clinton.
But Sanders said that he would still not vote for it.
They all attacked both Trump's trade war with China and the agreement he has made with it as not going far enough to protect American workers and interests.
Sanders decried the outsourcing of manufacturing and other industries to countries that pay their workers very little and said that he would force companies seeking government contracts to ensure work was done in the US.
Senator Amy Klobuchar and Biden presented themselves as moderates on domestic policies like health care in contrast to Sanders and Warren.
The number of serious candidates who reach the increasingly tougher qualifying standards for participation in the debates has been winnowed from 20 in the first debate in June to just six on Tuesday.
Four others, including the Hindu American candidate Tulsi Gabbard, are still in the race although they did not qualify for the debate.
There is yet another candidate, Michael Bloomberg who is a former mayor of New York and a billionaire owner the news and financial information company that bears his name.
He entered the race too late to run in the early primaries and caucuses or to participate in the debate. But he is running a massive TV campaign targeting Trump, rather than his party rivals.
Senator Corey Booker, an African American, withdrew from the race on Monday admitting he had no chance to win the nomination.
Senator Kamala Harris, who is of Indian and Jamaican-African heritage, quit last month.
In the US presidential election system, registered party members in each select nominees aligned to different candidates who would go to the party conventions and elect the party's candidate for the election.
The Democratic convention is in July.
The selection processes are by either secret ballots known as primaries followed in some states or caucuses where party members express their preferences openly at meetings.
The first one is a caucus in Iowa on February 3, followed by a primary in New Hampshire on February 11.
In the latest opinion poll in Iowa by Monmouth University Polling Institute, Biden is ahead with 24 per cent support, followed by Sanders with 18, Buttigieg with 17 and Warren with 15.
Nationally Biden is the front-runner with 27.2 per cent party support, according to Realclear Politics, the authoritative aggregator of polls. Sanders follows at 19.2 per cent, Warren at 16.6, Buttigieg at 7.2 and Bloomberg at 6.2.
(Arul Louis can be contacted at arul.l@.in and followed on Twitter @arulouis)
( With inputs from IANS )