After months of speculation about Mr Priebus’ fate, Mr Trump tweeted his decision as he landed in Washington after a speech in New York, in which he lavishly praised retired US Marines general Mr Kelly’s performance.
Mr Priebus, the former Republican National Committee chief, had been a frequent target of rumours about his job security amid infighting and confusion within the White House and a long whispering campaign by Trump allies.
Then, on Thursday, he was assailed in an astonishing foul-mouthed public rebuke by Mr Trump’s newly-appointed White House communications director Anthony Scaramucci.
Mr Priebus said he had offered his resignation on Thursday and the president accepted.
“I think the president wanted to go a different direction,” Mr Priebus told CNN just hours after his exit was announced.
He added that he agreed the White House might well benefit from “a reset”, saying: “I’m always going to be a Trump fan. I’m on Team Trump.”
Mr Trump’s Twitter announcement said: “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 ... and a Great Leader. John has also done a spectacular job at Homeland Security. He has been a true star of my Administration.”
He also saluted Mr Priebus, the chief of staff he had just pushed out, saying: “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!”
Mr Trump had focused on Mr Kelly in recent days, telling those close to him that he loved the general’s star power and believed military discipline was what his administration needed.
Mr Priebus could never bring a semblance of order to the team of in-fighting rivals that populate the Trump West Wing and questions about his future have long swirled around the office.
Those questions sharply escalated this week with the arrival of Mr Scaramucci, the hard-charging communications director who was hired over Mr Priebus’ objections.
Mr Priebus’ already tense relationship with Mr Scaramucci took a darker turn over the past two days when the communications chief suggested in a late-night tweet that Mr Priebus was one of the “leakers” Mr Trump has railed against.
The New Yorker magazine published an interview on Thursday in which Mr Scaramucci called Mr Priebus, amid an avalanche of vulgarity, a “paranoid schizophrenic”.
Mr Priebus, who hails from Wisconsin and has deep ties to House of Representatives speaker Paul Ryan, had grown increasingly isolated in the White House as past Republican National Committee colleagues and other allies have left or been pushed out.
They include former deputy chief of staff Katie Walsh, former communications chief Mike Dubke, press secretary Sean Spicer and press aide Michael Short.
Another early departure from the Trump White House was national security adviser Michael Flynn and Mr Trump ousted FBI director James Comey early on.
Mr Trump has also lobbed Twitter insults at attorney general Jeff Sessions recently.
Mr Ryan said Mr Priebus “has left it all out on the field, for our party and our country” and said he looked forward to working with Mr Kelly.
Both Mr Scaramucci and Mr Priebus travelled to New York’s Long Island with Mr Trump on Friday for a speech in which the president highlighted efforts to crack down on criminal gang MS-13.
The chief of staff took the return flight to Washington, his fate sealed in the tweets that were sent by the president, just as Mr Priebus stepped off the plane.
Shortly before the president left the plane, Mr Priebus’ black SUV pulled away, leaving the rest of the motorcade, including the president’s vehicle, in the distance.
Mr Trump eventually emerged, umbrella in hand, and delivered a brief statement on the runway as driving rain poured.
New York congressman Peter King, who sat opposite the outgoing chief of staff on Air Force One’s return flight to Washington, said Mr Priebus “kept a poker face”.
Mr Priebus, a political operative and lawyer, is expected to look for a corporate job or possibly write a book about his experience at the centre of the Trump storm.
One of the final establishment Republicans in the White House, he was a frequent target of barbs from Mr Trump over not being an early backer of the celebrity businessman’s candidacy.
As homeland security secretary, Mr Kelly took the lead on some of Mr Trump’s most controversial policies, including his executive orders suspending the admission of refugees and temporarily barring visitors from several Muslim-majority nations.
Those orders have been stripped down by courts pending a Supreme Court review in the autumn.