Hillary Clinton and Bernie Sanders have clashed over US involvement in the Middle East and gun control in the first Democratic presidential debate.

The pair outlined competing visions for a party seeking to keep the White House for a third straight term, but in a moment of political unity - and levity - Mr Sanders leapt to Ms Clinton's defence on the issue of her controversial email practices.

"The American people are sick and tired are hearing about your damn emails," Mr Sanders said as the crowd in Las Vegas roared with applause. A smiling Ms Clinton reached over to shake his hand and said: "Thank you, Bernie."

While the five candidates onstage took issue with each other, they also repeatedly sounded traditional Democratic themes - such as fighting income inequality - that are sure to carry over to the general election campaign against the Republicans.

Throughout most of the two-hour debate Ms Clinton played the role of aggressor, an unexpected shift for the Democratic front-runner who had barely mentioned her rivals since launching her campaign six months ago.

Until now, Ms Clinton and Mr Sanders - who has emerged as her toughest competition - have circled each other cautiously and avoided personal attacks.

After the Vermont senator, a self-described democratic socialist, derided "a casino capitalist process by which so few have so much", Ms Clinton said it would be a "big mistake" for the US to turn its back on the system that built the American middle class.

Asked whether she thought Mr Sanders, who has a mixed record on gun control legislation, had been tough enough on the issue, she said: "No, I do not."

Mr Sanders defended his record and called for better mental health services, stricter background checks and closing a loophole that exempts gun shows from background checks.

The two also tangled over foreign policy, an issue where Ms Clinton is often more hawkish than others in the Democratic Party. The former secretary of state reiterated her call for more robust US action to stop the Syrian civil war and defended her judgment on international issues, despite having voted for the 2002 invasion of Iraq.

Mr Sanders called the Iraq war "the worst foreign policy blunder in the history of our country" and said he would not support sending American combat troops back to the Middle East to fight terrorism.

"Nobody does, Senator Sanders," Ms Clinton interjected.

Joining them on stage was a trio of low-polling candidates looking for a breakthrough moment: former Maryland governor Martin O'Malley, Jim Webb, a former navy secretary and US senator from Virginia, and former senator and governor Lincoln Chafee, the Republican-turned-independent-turned-Democrat from Rhode Island.

Also hanging over the debate were the lengthy deliberations of Joe Biden, who is weighing a late entry into the Democratic race. Debate host CNN kept an extra podium on standby in case Mr Biden decided to show up, but the vice president stayed in Washington, watching the debate at his residence.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.