The ten leading US Republican Party candidates, who are hoping to secure the party's nomination for next year's presidential election, have taken part in their first televised debate.

During the opening, front-runner Donald Trump refused to rule out running as an independent.

All the candidates directed their criticism towards the leading Democratic contender, Hillary Clinton, but they also clashed on policy issues including immigration and abortion.

Senator Rand Paul of Kentucky was the only contender to directly take on Mr Trump, challenging him after he kicked off the debate by refusing to pledge his support for the Republican nominee in the November 2016 election.

"I will not make the pledge at this time," said Mr Trump, who for weeks has said he would not rule out an independent bid that would likely split the Republican vote and boost the chances of victory for Mrs Clinton or another Democrat.

His response drew boos from the crowd and a rebuke from Mr Paul, who said Mr Trump was keeping his options open to support Mrs Clinton, a veiled reference at his past friendship with both her and her husband, Bill.

"He's already hedging his bets because he's used to buying politicians of all stripes," Mr Paul said.

Pressed by Fox News moderator Megyn Kelly about past derogatory comments he had made about women, including calling them "fat pigs," "dogs," and "slobs," Mr Trump dismissed the question as "political correctness".

He accused Ms Kelly of not treating him well, drawing more boos from the audience.

"Honestly Megyn, if you don't like it, I'm sorry. I've been very nice to you although I could probably maybe not be based on the way you have treated me," Mr Trump, whose base of support is overwhelmingly male, said to a mixture of boos and applause.

The billionaire has been the centre of campaign attention for weeks for his personal attacks on rivals and his scathing comments about Senator John McCain's war record and about Mexican immigrants.

He kept it up in the debate, calling the Mexican government "much smarter, much sharper, much more cunning and they send the bad ones over".

The sometimes combative nature of the debate made it difficult for more measured candidates like former Florida Governor Jeb Bush, who is second in the polls, and Wisconsin Governor Scott Walker to make an impact.

Mr Bush, Mr Walker and the other top contenders largely steered clear of tangling with Mr Trump, focusing on their records and the conservative policies they would pursue if elected.

Mr Bush did call Mr Trump's rhetoric "divisive" and said "we're going to win when we unite people with an optimistic message".

Mr Trump has rocketed to the top of opinion polls amid the controversies, heightening anticipation for the debate against rivals Mr Paul, Mr Bush, Mr Walker, Marco Rubio and five other Republican hopefuls.

Before the main event, seven candidates whose poll ratings did not qualify them for prime time took part in a separate day-time debate.

Several challenged Mr Trump's conservative credentials, noting he had changed positions on abortion, healthcare and other issues.

But Carly Fiorina, a former business executive and the only woman in the Republican field, acknowledged Mr Trump had tapped into a broad sense of frustration with Washington.

"Whatever your issue, your cause, the festering problem you hoped would be resolved, the political class has failed you. That's what Donald Trump has tapped into," said Ms Fiorina, who was the runaway choice at more than 80% when Fox News asked viewers to tweet who they thought won the first debate.

Shortly after the early debate, social media interest in Ms Fiorina surpassed interest in Mr Trump, according to Google analytics.