US President Donald Trump has sent his beleaguered chief of staff Reince Priebus packing, replacing him with retired Marine Corps general and current Homeland Security Secretary John Kelly.

"I am pleased to inform you that I have just named General/Secretary John F Kelly as White House Chief of Staff. He is a Great American....," Mr Trump said on Twitter.

Mr Priebus told CNN that he had resigned on Thursday.

John F Kelly

Mr Priebus has been involved in a feud with Mr Trump's new communications director Anthony Scaramucci.

Mr Scaramucci launched a foul-mouthed attack on his most senior colleagues on Thursday, using language that US television networks refused to repeat.

In an exchange with a New Yorker reporter, Mr Scaramucci ranted about Mr Priebus and chief White House strategist Steve Bannon.

"Reince is a paranoid schizophrenic," Mr Scaramucci was quoted as saying in an expletive-filled tirade in which he accused the chief of staff of damaging information leaks.

"They're trying to resist me, but it's not going to work," he said, adding that Mr Priebus would soon resign.

Meanwhile, US Senate Republicans have failed to overturn the healthcare law known as Obamacare.

It is a stinging blow to Mr Trump that effectively ended the Republican Party's seven-year quest to repeal the 2010 Affordable Care Act.

Three Republicans, Senators John McCain, Susan Collins and Lisa Murkowski, crossed party lines to join Democrats in a dramatic 49-to-51 vote to kill the bill.

Mr Trump reacted on Twitter by saying that those Republicans and Democrats had let the US down.

He urged Republican congressional leaders to let Obamacare "implode" rather than immediately work to fix it.

The extraordinarily tense vote began just before 1.30am local time (6.30am Irish time) this morning.

Republican leaders had decided to vote on a pared-down proposal to repeal portions of Obamacare known as the "skinny bill" after failing to reach consensus on a more comprehensive measure after the US House of Representatives approved their bill in May.

"This is clearly a disappointing moment," Senate Majority Leader Mitch McConnell said on the floor after the vote.

"I think the American people are going to regret that we couldn't find a better way forward," he said.

Despite controlling the Senate, the House and the White House, Republicans have struggled for months with repealing Obamacare.

Obamacare is a complex law approved by Democrats in 2010 under former president Barack Obama that provided health insurance to millions of previously uninsured Americans.

Mr Trump, who campaigned for the White House on promises to repeal Obamacare, has offered no legislation of his own and little guidance to the Senate, although he has berated them for their inaction.

A White House media spokeswoman could not immediately be reached for comment on the bill's failure.

Republicans hold 52 seats in the 100-seat Senate and Mr McConnell could only afford to lose support from two Republican senators, with the tie-breaking vote to be cast by Vice President Mike Pence, who was on the Senate floor.

All eyes were on Mr McCain, who flew back from Arizona after being diagnosed with brain cancer in order to vote, and sat with Ms Collins, Ms Murkowski, and Senator Jeff Flake, also from Arizona.

Ms Collins and Ms Murkowski both voted against more comprehensive Republican proposals to repeal and replace Obamacare this week.

Mr Trump has singled out Mr Murkowski for criticism, saying on Twitter that she had let down the Republican Party and the country.

Mr McCain was approached minutes before the vote by Mr Pence and Republican Senator Lindsey Graham.

Mr Graham had said yesterday he had decided to vote for the skinny bill after reassurances from House Speaker Paul Ryan that it would not become law.

After speaking to Mr Pence and Mr Graham for some time, Mr McCain walked across the floor to tell Senate Minority Leader Chuck Schumer and Senators Dick Durbin, Elizabeth Warren, Amy Klobuchar and Dianne Feinstein that they had his vote.

Ms Feinstein embraced him as voting began.

Cheers erupted in the Senate chamber as Mr McCain cast what was believed to be the deciding "no" vote.

After the bill's failure, Mr Schumer told the Senate that it was time to heed Mr McCain's call this week to return to a more transparent and bipartisan legislative process.

"He's a hero, he's a hero of mine," Mr Schumer told reporters after the vote.