After months of speculation about Priebus' fate, Trump tweeted his decision just as he landed in Washington after a speech in New York in which he lavishly praised Kelly's performance at Homeland Security.
Priebus, the former Republican National Committee head, was the frequent target of rumors about his job security amid infighting and confusion within the White House and a long whisper campaign by Trump allies. Then, he was the subject of a remarkable public rebuke on Thursday by the new White House communications director.
Priebus told allies that he had offered his resignation to Trump on Thursday.
Trump's announcement on Twitter 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 Priebus, the chief of staff he had just pushed out.
"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!"
Speaking to reporters on the tarmac at Joint Base Andrews outside Washington, Trump said: "Reince is a good man. John Kelly will do a fantastic job."
Kelly is a retired Marine four-star general. Trump had focused on him in recent days, telling those close to him that he believed military discipline was what his administration needed.
Priebus never could bring a semblance of order to the team of in-fighting rivals that populate Trump's West Wing, and questions about his future have long swirled around the office. Those questions sharply escalated this week with the arrival of Anthony Scaramucci, the hard-charging communications director who was hired over Priebus' objections.
Priebus' already tense relationship with Scaramucci took a darker turn over the past two days when the communications chief suggested in a late-night tweet that Priebus was one of the "leakers" that Trump has railed against. The New Yorker magazine published an interview Thursday in which Scaramucci called Priebus, amid an avalanche of vulgarity, a "paranoid schizophrenic."
Both Scaramucci and Priebus traveled to New York's Long Island with Trump on Friday for a speech in which the president highlighted efforts to crack down on the gang MS-13. Priebus took the return flight to Washington, which had to circle the runway due to a storm, his fate sealed in the tweets that were sent by the president just as he stepped off the plane.
Shortly before the president deplaned, Priebus' black SUV pulled away, leaving the rest of the motorcade, including the president's vehicle, in the distance. The president eventually emerged, umbrella in hand, and delivered a brief statement on the runway as driving rain poured.
Priebus did not respond to reporters' shouted questions. His term ends in fewer than 200 days, the shortest tenure for any president's first White House chief of staff since the post was formally established in 1946.
From day one, Priebus' power has been limited compared with past officials with his title. In a highly unusual arrangement, Trump said at the outset that Priebus and chief strategist Steve Bannon would serve as "equal partners" in implementing his agenda.
Priebus, who hails from Wisconsin and has deep ties House 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 of the West Wing. Those who have departed include former deputy chief of staff Katie Walsh, outgoing press secretary Sean Spicer and press aide Michael Short.
Ryan, in a statement, said Priebus "has left it all out on the field, for our party and our country." Ryan added that he looked forward to working with Kelly.
Scaramucci was the latest top aide to be granted a direct line to Trump, and it became increasingly unclear who actually reported to Priebus. Though Priebus forged an uneasy truce with his former foe Bannon, powerful White House aides Ivanka Trump and her husband, Jared Kushner, were both supportive of Kelly's hire, according to a person familiar with the matter but not authorized to speak publicly about private discussions.
Priebus also was blamed by some within the White House for the failure of the Republican health care plan, with some Trump allies believing that Priebus' longtime relationships with Republicans on Capitol Hill should have ensured the bill's passage.
Rather than return to the Republican National Committee, Priebus - a political operative and attorney - is expected to look for a corporate job or possibly write a book about his experience in the center of the Trump storm.
As Homeland Security secretary, Kelly has taken the lead on some of 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 this fall.
People who know Kelly told The Associated Press that he was not aware of the details of those initial orders until around the time that Trump signed them. Yet, just days after taking office, Kelly had to lead the agency as it dealt with the chaos and confusion that ensued at airports in the U.S. and around the world. He defended the orders to reporters and lawmakers and insisted that he indeed had been part of the decision-making process.
Kelly has also pushed for support for Trump's signature campaign pledge to build a wall along the southern border, though he acknowledged at his confirmation hearing that "a physical barrier in and of itself will not do the job."
Republican Sen. Lindsey Graham of South Carolina, a frequent Trump critic, said that, as Homeland Security chief, Kelly has "been very effective in engaging members of Congress and communicating a coherent message for the President."
"Secretary Kelly is one of the strongest and most natural leaders I've ever known," Graham said.
Associated Press writers Catherine Lucey, Vivian Salama, Steve Peoples and Laurie Kellman contributed reporting.