Zachary Terwilliger was sworn in as U.S. attorney for the Eastern District of Virginia. (N/A/Department of Justice)

Former prosecutor and Justice Department staffer G. Zachary Terwilliger was sworn in as U.S. Attorney for the Eastern District of Virginia on Friday, bringing together DOJ leaders for a rare moment of unity in a chaotic week.

Terwilliger, who began his career as an intern in the Eastern District and returned later as a gang and violent crimes prosecutor, spent 18 months working under former attorney general Jeff Sessions and Deputy Attorney General Rod J. Rosenstein at Justice Department headquarters.

Terwilliger was appointed to the position in May and confirmed by the Senate in August, but Friday marked his formal investiture.

Sessions, ousted from office just two days earlier, did not attend. But Rosenstein gave pointed remarks on the Justice Department’s moral responsibilities, saying “the rule of law depends on the character and conduct of the people who enforce the law.”

Looking on was acting attorney general Matthew G. Whitaker, whose appointment has thrown into doubt the future of the Russia investigation Rosenstein oversees. President Trump is distancing himself from his appointee amid questions about his past comments on that probe and his involvement with a company accused of deceiving clients.

Terwilliger, who has won many allies in his 10-year Justice Department career with a cheerful demeanor and indefatigable work ethic, thanked all three in his remarks. He earned a rare laugh from Whitaker with an allusion to Rosenstein’s embattled tenure, joking that when he first became chief of staff, “back then, everybody loved Rod.”

By the end, he said he felt like the “Maytag repairman . . . going through the crisis of the day.”

He praised Rosenstein as one of “the most dedicated public servant[s]” he has known and thanked Sessions repeatedly for bringing him into a job he called “the most transformative of my professional life.”

Terwilliger added that it was “an honor to support” Whitaker, saying he appreciated his call to “keep moving forward.”

Rosentein, in turn, made his own reference to the Russia investigation, joking that “the only bad advice” Terwilliger ever gave him was that after his confirmation hearing, he would “probably not have to return” to Capitol Hill because “the deputy attorney general is rarely called to testify before Congress.”

Otherwise, he said, Terwilliger was an exemplary aide, who “always respected the importance of avoiding distractions and remaining focused on the things that really matter.”

His time at the Justice Department, Terwilliger said, was a “sprint” through “waves of crises” that sometimes found him catching a few hours of sleep on a pleather couch with a tarp for a sheet.

Terwilliger has always been a fighter, Anne G. Terwilliger said in a speech that touched on her husband’s premature birth, childhood battles with dyslexia and doubts he had about his future while in law school.

“No one else dug deeper,” she said. “Zach fought hard for many years to get here.”

He was first hired as a full-time assistant prosecutor in Virginia by former U.S. attorney Neil MacBride, who called him a “prosecutor’s prosecutor” focused on the most vulnerable.

Terwilliger said he knew he wanted to be a federal prosecutor in the office from the time he interned there in high school and saw Assistant U.S. Attorney Patricia Giles give the closing arguments in the trial of the killers of Brenda Paz, a pregnant 17-year-old murdered for testifying against members of MS-13.

In her words, Terwilliger said, he saw “the awesome power of preparation and righteousness.”

Judge T.S. Ellis III, one of several judges who spoke warmly at the event, said he knew the first moment he saw the Terwilliger in court that he would be “splendid.”

“It’s because I had an idol,” Ellis said — former Chicago Cubs player Wayne Terwilliger. When the young prosecutor confirmed they were in fact related, Ellis said, “your future was assured.”