Mr. Priebus said he had tendered his resignation to the president on Thursday, the same day the newly appointed White House communications director, Anthony Scaramucci, was quoted vowing to force the chief of staff out. Even so, as late as Friday morning, Mr. Priebus told colleagues that he thought he would have a week before the announcement to make a graceful exit, but he evidently learned otherwise later in the day. Mr. Kelly will take over the corner office in the West Wing on Monday.
Mr. Priebus said after the announcement that he had always made clear to Mr. Trump that when the president thought it was time for a new chief, he would support that. “The president has a right to change directions,” he said on CNN. “The president has a right to hit a reset button. I think it’s a good time to hit the reset button.”
He expressed no bitterness about his removal. “I’m always going to be a Trump fan,” he said. “I’m on Team Trump, and I look forward to helping him achieve his goals and his agenda for the American people.”
Mr. Kelly will be the first current or former general to serve as White House chief of staff since Alexander M. Haig in the final stretch of President Richard M. Nixon’s administration. Some advisers to Mr. Trump opposed the choice, arguing that Mr. Kelly did not have the political background for the job.
“The president needs someone who understands the Trump constituency as his chief of staff, someone who has both administrative skills and political savvy,” Roger Stone, Mr. Trump’s off-and-on adviser, said, anticipating Mr. Kelly’s selection before the announcement was made.
The rainy Friday afternoon shake-up added to the sense of instability in Mr. Trump’s White House. In six months in office, he has fired a national security adviser, an F.B.I. director and a holdover acting attorney general, while his White House press secretary, communications director, deputy chief of staff, deputy national security adviser and legal team spokesman have all left.
Privately, even Mr. Priebus’s critics wondered how Mr. Kelly would surmount the same challenges — controlling a freewheeling president who often circumvents paid staff members by seeking counsel from a roster of outside advisers.
Other aides were left to wonder about their own future. Mr. Trump has considered pushing out Stephen K. Bannon, his chief strategist, according to a White House official who discussed internal deliberations on the condition of anonymity. Several conservative supporters of Mr. Bannon — including Representative Mark Meadows, the House Freedom Caucus chairman — told Mr. Trump on Friday that the president would risk losing base supporters if he let the strategist go.
Mr. Bannon also helped bring Mr. Kelly into the administration during the transition, and was among those who supported his move to chief of staff, an official familiar with his position said.
Mr. Priebus’s departure was announced 15 hours after the president’s signature drive to repeal his predecessor’s health care program collapsed on the Senate floor and a day after an ugly feud with Mr. Scaramucci erupted in a public airing of the deep animosities plaguing the White House. Mr. Priebus had collaborated with his ally, Speaker Paul D. Ryan, on health care and pushed a bill through the House only to watch it crater in the upper chamber.
“My view is Reince was very well liked by the president, but Donald Trump is a guy who’s all about results, and he will always be looking not only at everyone around him and their results, but his own results,” said Christopher Ruddy, the chief executive of Newsmax Media and a friend of the president’s. “I think he’s taking stock and seeing that this health care thing that was promised to him by Reince and Paul Ryan was not properly developed. In my view, he’s a disappointed customer.”
Mr. Priebus, a former chairman of the Republican National Committee, represented the establishment that Mr. Trump had run against and never won the president’s full confidence nor was granted the authority to impose a working organizational structure on a West Wing that included multiple power centers, including the president’s daughter, Ivanka Trump, and son-in-law, Jared Kushner. Always seeming to be on the edge, Mr. Priebus had hoped to last a full year, but in the end no other White House chief of staff has been forced out after such a short tenure.
Mr. Kushner soured on Mr. Priebus, partly because of what he viewed as the shortcomings of Sean Spicer, an ally of Mr. Priebus’s who was the White House press secretary until last week. Other top aides bristled at Mr. Priebus’s demeanor or suspected that he was undermining them, while an alliance of convenience with Mr. Bannon seemed to fade in recent weeks.
Mr. Trump signaled Mr. Priebus’s fate a week ago by hiring Mr. Scaramucci over the chief of staff’s objections. Mr. Priebus had blocked Mr. Scaramucci from joining the White House staff for six months, and Mr. Spicer resigned in protest.
Mr. Priebus and Mr. Spicer had told the president that they believed Mr. Scaramucci, a gregarious but edgy hedge fund manager and fund-raiser, lacked the required political experience and organizational skills. In the end, however, those warnings fell on deaf ears and, adding insult to injury, Mr. Scaramucci made clear when he was hired that he reported not to Mr. Priebus, but directly to the president.
Mr. Scaramucci quickly engaged in open war against Mr. Priebus — with the president’s encouragement. By Wednesday, the new communications chief publicly suggested that the chief of staff was a leaker and threatened to seek an F.B.I. inquiry.
On Thursday evening, The New Yorker posted an interview with Mr. Scaramucci that included a profanity-laced tirade against Mr. Priebus. He called Mr. Priebus a “paranoid schizophrenic, a paranoiac,” who had leaked information against him, and vowed to get the chief of staff fired. “He’ll be asked to resign very shortly,” Mr. Scaramucci said.
Mr. Priebus let the insults go unanswered, and on Friday morning both men were in close quarters together aboard Air Force One with the president flying to Long Island for an event about gangs. Others on the plane said Mr. Priebus had given no indication of what was to come.
“We didn’t even know it,” said Representative Peter King, Republican of New York, who was on board. “We were sitting right across from him and he kept a poker face.”
Mr. Priebus, who was raised in Wisconsin, rose through the ranks of the Republican Party to be his state’s chairman, establishing relationships with party donors and taking over the national party in 2011.
During last year’s campaign, Mr. Priebus was slow to embrace Mr. Trump’s candidacy, and the president, who sometimes called him “Reincey” in private, never let his chief of staff forget it. Mr. Trump often reminded people around him that Mr. Priebus had suggested that he consider dropping out after an “Access Hollywood” tape of Mr. Trump’s crude remarks about women was made public in October.
At one point in the campaign, Mr. Trump dismissed Mr. Priebus by saying, “We’re not dealing with a five-star Army general.”
But he put that aside to hire Mr. Priebus to help guide him through a capital that had never seen a president who had not served in politics or the military. Despite their differences, Mr. Trump summoned Mr. Priebus onstage on election night to praise him as a “superstar” and compare him to the horse Secretariat.
“I’ll tell you, Reince is really a star,” Mr. Trump said, using language that he would repeat less than a year later about the man he picked to replace Mr. Priebus.
An earlier version of this article misidentified the state where Reince Priebus was born. He is a native of New Jersey, not of Wisconsin.
Continue reading the main story