President Donald Trump replaced his beleaguered White House chief of staff, Reince Priebus, after only six months on the job on Friday, installing retired General John Kelly in his place in a major shake-up of his top team.

Trump announced the move in a tweet a day after his new communications director, Anthony Scaramucci, accused Priebus of leaking information to reporters in a profanity-laced tirade.

Kelly, 67, a retired four-star Marine Corps general, is currently secretary of the Department of Homeland Security and will assume the chief of staff post on Monday. He was hired with the goal of bringing more discipline to the White House, a senior White House official said.

Trump issued his decision just as he landed aboard Air Force One after a visit to Long Island and hours after Republican efforts to repeal Obamacare failed in the Senate.

Priebus was on the plane with the Republican president and made no comment. Reporters had noticed no sign of stress from Priebus during the day.Priebus told CNN he had been talking to Trump for some time about exiting the White House, and is the latest in a long line of officials to leave or not take a job at the White House.

"The president has a right to hit a reset button. I think it's time to hit the reset button," Priebus said in a televised interview from the White House. "He intuitively determined that it was time to do something different, and I think he's right."

Trump had lost confidence in Priebus, privately questioning his competence after major legislative items failed to pass the U.S. Congress, a Trump confidant said.

A source close to Priebus said the former Republican National Committee chairman turned in his resignation on Thursday night, after Scaramucci's rant against him was published by the New Yorker magazine.

A senior White House official said Trump had informed Priebus two weeks ago that he would be replacing him and that the move had no connection to Scaramucci, whose hiring a week ago prompted Sean Spicer, a Priebus ally, to abruptly resign as press secretary.

After frequent conversations with Kelly, Trump recently warmed up to the idea of naming Kelly chief of staff to more effectively manage personnel and offered it to him earlier this week, a senior White House official said.

KELLY 'A STAR'

Carrying an umbrella, Trump approached reporters as he stepped off Air Force One, with rain storming down.

"Reince is a good man. John Kelly will do a fantastic job. General Kelly has been a star, done an incredible job thus far, respected by everybody. He's a great, great American. Reince is a good man," Trump said.

Priebus' 189-day tenure was the shortest in modern history for a White House chief of staff. He had hoped to stay on at least a year but struggled to manage his unpredictable boss and was unable to get a handle on conflicting factions in the White House who have frequently squabbled.

In a statement, Priebus said it had been one of the great honors of his life to serve Trump and the country.

"I will continue to serve as a strong supporter of the president's agenda and policies. I can't think of a better person than General John Kelly to succeed me and I wish him God's blessings and great success," he said.

Trump loyalists had chafed at Priebus, feeling he had installed his RNC allies at the White House and overlooked the people close to Trump who helped get him elected president in November.

But Priebus allies felt he was an important link to establishment Republicans in Washington as the capital attempted to adjust to the anti-establishment style of the president.

"He has served the president and the American people capably and passionately," House of Representatives Speaker Paul Ryan said of his close friend in a statement. "He has achieved so much, and he has done it all with class. I could not be more proud to call Reince a dear friend."

White House spokeswoman Sarah Sanders said she did not think Priebus' exit would affect the White House's relationship with the Republican Party.

"I think we've still got a good relationship. We're going to continue working with the party and doing what we came here to do," she said.

Homeland Security Deputy Secretary Elaine Duke will become the acting chief of the department on Monday, DHS said in a statement.

U.S. Representative Michael McCaul, a Texas Republican who chairs the House Homeland Security Committee, is among those being considered for Homeland Security secretary, a DHS official said.