WASHINGTON — Last month, Rod J. Rosenstein, the deputy attorney general at the center of the crisis building around President Trump’s White House, gathered with federal prosecutors and law enforcement officials to bid farewell to his old job, United States attorney in Maryland, and celebrate his new one.

At an interfaith center in Columbia, Md., as guests nibbled on egg rolls and miniature roast beef sandwiches, Mr. Rosenstein joked darkly about the low pay and high burnout rate that come with being the No. 2 official at the Department of Justice. His daughter would have to wait for the big yard she had been wanting, he said, and the average length of tenure for the post he was about to assume was little more than a year.

“He was happy, but he was also cleareyed about what he was getting himself into,” said James M. Trusty, a friend and former colleague from Mr. Rosenstein’s days as a federal prosecutor in Maryland, who attended the going-away party. “He knew going in that this is kind of a meat grinder, that nobody comes out of the deputy attorney general position without aging.”

Yet Mr. Rosenstein, sworn in on April 26, could hardly have predicted the speed at which he would become embroiled in a high-stakes drama at the uppermost echelons of government. In the past two weeks, he has been saddled with a leading role in the firing of an F.B.I. director, called to answer for the shifting explanations of a White House in chaos and ultimately moved to name a special counsel now investigating the president himself.