Media playback is unsupported on your device Media caption The Republican candidates for president traded sharp blows

The Republican candidates for president traded sharp blows over foreign policy and the future of the Supreme Court in an often unruly and chaotic debate.

After Iowa and New Hampshire, the race has now moved to South Carolina before the 20 February primary.

Front-runner Donald Trump repeatedly tangled with Texas Senator Ted Cruz and former Florida Governor Jeb Bush in a series of tense exchanges.

The lively audience repeatedly jeered and booed the candidates.

As the candidates shouted down and interrupted each other, CBS moderator John Dickerson warned: "We're in danger of driving this into the dirt."

Debate highlights:

The death of Supreme Court Justice Antonin Scalia, creating a vacancy on the court, shifted the discussion towards social issues like gay rights and abortion

Mr Trump pledged to stop using vulgar terms on the campaign trail

Florida Senator Marco Rubio bounced back after stumbling in a previous debate performance

Mr Rubio again clashed with Mr Cruz on immigration reform. Mr Rubio said Mr Cruz's shifting position on immigration was just another example of his dishonesty

Ohio Governor John Kasich continued to push what he sees as a positive campaign message, decrying the sharp attacks of the night

Mr Trump said he would work with Congress to penalise companies, which move factories and jobs to Mexico.

Image copyright Twitter Image caption Republican pollster Frank Luntz was one of many commentators who were concerned about the tone of the debate

Mr Trump and Mr Bush clashed over the war in Iraq and President George Bush's role during the 11 September attacks.

Jeb Bush responded robustly to Mr Trump's attacks, a departure for the former governor who originally sought a "joyful" campaign.

"We should have never been in Iraq," Mr Trump said.

"They lied. They said there were weapons of mass destruction. There were none and they knew that there were none."

Analysis: Laura Bicker, BBC News, in Greenville, South Carolina

Image copyright Getty Images Image caption This time, Jeb Bush was prepared for Donald Trump's attacks

The Republicans had been looking for a fight before this debate even started. There was a sombre moment to mourn the death of Justice Antonin Scalia. That paved the way for an obvious opening question: who should nominate his successor to the Supreme Court? This president, who would try to appoint a liberal-leaning successor? No, cried Republicans.

On stage, Donald Trump was already out of step and said he was certain President Obama would make the nomination whether Republicans liked it or not.

From there, the debate almost descended into an all-out brawl with the billionaire at its centre. The frontrunner took every opportunity to set himself apart as the outsider, dismayed with the state of politics. He saved the bulk of his ire for Jeb Bush, who has been his target for months. But this time the former Florida governor was ready. He stayed calm and didn't fluff his lines.

It meant Mr Trump came across more as the pantomime villain and the audience reacted accordingly, by booing.

This debate will not be remembered by stand-out performances. Instead, voters witnessed some of the most bitter exchanges of the campaign so far.

Mr Bush pushed back, defending his brother who will soon join Mr Bush on the campaign trail before the pivotal South Carolina primary.

"I'm sick and tired of Barack Obama blaming my brother for all the problems that he's had and frankly I could care less about the insults Donald Trump gives against me," Mr Bush said.

Justice Scalia's death was addressed early on in the debate most of the six candidates saying the next president should choose his replacement.

Media playback is unsupported on your device Media caption Donald Trump: "They lied. They said there were weapons of mass destruction. There weren't none"

Mr Cruz said "we are one justice away" from the court reversing conservative legal gains.

Mr Trump said President Obama would probably pick a replacement, but stressed that Republicans in the Senate should block him.

"Delay, delay, delay," Mr Trump said.

Later, Mr Cruz contended that Mr Trump, who has supported Democrats in the past, would nominate liberal Supreme Court justices if elected president.

"You are the single biggest liar," Mr Trump said to Mr Cruz. "This guy will say anything."

The next primary and caucus is in South Carolina next week. Other states will have their turn over the coming weeks and months.

Each party formally announces their presidential candidate at conventions in July, four months before the presidential election.

Key dates to come

20 February - South Carolina primary (Republican); Nevada caucus (Democrat)

23 February - Nevada caucus (R)

27 February - South Carolina primary (D)

1 March - 'Super Tuesday' - 15 states or territories decide

18-21 July - Republican convention, nominee picked

25-28 July - Democratic convention, nominee picked

8 November - US presidential elections

In depth: Primary calendar