President Donald Trump has appointed Homeland Security Secretary John F. Kelly, a military veteran, as his chief of staff after a growing rift with Reince Priebus, who gave up his top role at the Republican National Committee for the job.

Priebus has been lambasted by the president's new communications director, Anthony Scaramucci, in posts on social media site Twitter this week as well as a profanity-laced interview with New Yorker writer Ryan Lizza.

Scaramucci, the former head of hedge fund Skybridge Capital, told the New Yorker this week that he blamed Priebus for blocking his appointment to any administration role until this month. He also accused the chief of staff of leaking information about Scaramucci joining the president, first lady and others at a White House dinner and said Priebus would soon be asked to resign.

"This is going to get cleaned up very shortly," he told Lizza in the interview. "I want to get the president's agenda on track so we can succeed for the American people."

Trump, a real estate mogul with no prior political experience, surprised financial markets and pollsters when he defeated former Secretary of State Hillary Clinton in November's presidential election. An initial market rally has slowed, however, as Trump has so far failed to deliver on promises to reduce taxes and overhaul Obamacare and faced increasing scrutiny over Russia's links with his campaign.

Since his inauguration, the president has fired Acting Attorney General Sally Yates for refusing to enforce a travel ban on residents of some Muslim nations, dismissed National Security Adviser Michael Flynn amid concerns about conversations with Russian officials after the election and terminated FBI Director James Comey after he refused to drop a review of the matter.

Press Secretary Sean Spicer, an ally of Priebus resigned this month, reportedly in protest of Scaramucci's appointment.

Kelly, the new White House chief of staff, is a former senior military assistant secretary of defense during Barack Obama's first term as president. He enlisted in the U.S. Marine Corps. in 1970.

He "is a great American and a great leader," Trump said in a Twitter post. "John has also done a spectacular job at Homeland Security. He has been a true star of my administration."

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....

— Donald J. Trump (@realDonaldTrump) July 28, 2017

...and a Great Leader. John has also done a spectacular job at Homeland Security. He has been a true star of my Administration

— Donald J. Trump (@realDonaldTrump) July 28, 2017

I would like to thank Reince Priebus for his service and dedication to his country. We accomplished a lot together and I am proud of him!

— Donald J. Trump (@realDonaldTrump) July 28, 2017