From rushing out ill-prepared executive orders to arguing over the president’s Twitter fixation, Mr. Priebus struggled as none of his predecessors had before in a job that is historically among the toughest in Washington. “Take everything you’ve heard and multiply it by 50,” he said. Working for Mr. Trump, he added, was “like riding the strongest and most independent horse.” But he expressed admiration for Mr. Trump’s toughness and allowed that perhaps the president was right about Twitter.

The meeting that nearly led to Mr. Sessions’s resignation came last May shortly after the president fired James B. Comey, the F.B.I. director who was heading an investigation into Russia’s interference in the 2016 presidential election and any cooperation with Mr. Trump’s campaign. The dismissal of Mr. Comey, which Mr. Trump in an interview with NBC News linked to his unhappiness with the Russia investigation, triggered the appointment of a special counsel, Robert S. Mueller III, to the ire of the president.

Mr. Trump was furious with Mr. Sessions for recusing himself from the Russia investigation and therefore losing control over it. Mr. Priebus’s account confirms and adds more detail to a New York Times report that the president berated Mr. Sessions in a meeting in the Oval Office, leading him to offer his resignation. Vice President Mike Pence and the White House counsel, Donald F. McGahn II, were in the meeting, but Mr. Priebus was not.

“Don McGahn came in my office pretty hot, red, out of breath and said, ‘We’ve got a problem,’” Mr. Priebus recalled. “I responded, ‘What?’ And he said, ‘Well, we just got a special counsel and Sessions just resigned.’ I said, ‘What? What the hell are you talking about?’ And I said, ‘That can’t happen.’”

Mr. Priebus bolted down the back stairway of the West Wing and out the door to the parking lot and found Mr. Sessions in the back of a black sedan with the engine running and about to leave. “I knocked on the door of the car and Jeff was sitting there and I just jumped in and shut the door and I said, ‘Jeff, what’s going on?’” Mr. Priebus said. “And then he told me that he was going to resign.”