They don’t make staffers like Joe Donoghue anymore.

Donoghue, 49, just ended a more than 31-year run working his way up from the mail room to the pinnacle of power in the U.S. Senate, almost all of it at the side of Sen. John McCain (R-Ariz.).

Donoghue helped expose wasteful spending and helped write legislation that overhauled campaign finance and ethics laws. He worked two presidential campaigns and made his fair share of mistakes that led to some lively tongue lashings. Finally, he served as a de facto counselor for a staff working for someone they adored, grieving with them after he died.

Donoghue wouldn’t change a thing. “I grew up here; it’s a wonderful place,” he said in an interview last month just before leaving the Senate. His final wish is for young aides to have nearly as much fun as he had: “Get an appreciation for it and learn to love it. There’s no place like it in the world.”

He’s one of several congressional staff who left in recent months after decades of service. They are people like Mark Prater, who spent 28 years working for the Senate Finance Committee; or Jill Kozeny, who devoted 30 years to Sen. Charles E. Grassley (R-Iowa); or Hugh Halpern, who spent 32 years working for House committees and GOP leadership.

Thankfully, there are still some lifers left on Capitol Hill. George Kundanis, a 42-year veteran of House Democratic circles, has a decade more experience in Congress than his boss, House Speaker Nancy Pelosi (D-Calif.). Bernie Raimo, Pelosi’s counsel, first set foot under the dome in the late 1960s. And Sharon Soderstrom, Senate Majority Leader Mitch McConnell’s chief of staff, got her first Senate job in 1983 and never left.

The institutions within the institution, they know more about Congress than many duly elected members. At a time when the federal workforce is taken for granted, these staffers have dedicated most of their adult lives to resolving standoffs like the partial shutdown that now stretches into its fourth week, the longest in history.

Without people like Kundanis and Soderstrom, Congress would never figure out how to reopen the federal government.

These veteran staff, paid low-six-figure salaries, stayed behind as dozens of their co-workers left for exponentially richer private-sector jobs.

What makes Donoghue’s experience so rare was the singular tie to one person, building a father-son bond over 31 years with someone who literally made history.

The ninth of 13 children from a family in Hagerstown, Md., Donoghue spent his first few weeks as a freshman at Catholic University in 1987 trying to get a job to help pay for school. At the urging of an older brother, he went door to door to Senate offices searching for work, not sure who was a Democrat or a Republican.

Aides to McCain, new in the Senate, hired him to work the mail room for 20 hours a week. After a couple of years Donoghue convinced McCain to hire him full time and enrolled in Georgetown University’s night program, gaining a foothold in McCain’s inner circle.

He earned his early stripes by rooting out egregious earmarks, the now forbidden practice of directing federal agencies to spend on narrow interests. It was lonely at first, until Sam Brownback (R-Kan.) joined the Senate in 1997 and a young Brownback staffer named Paul D. Ryan joined the cumbersome task of combing through legislation looking for waste.

“He eliminated an awful lot of my earmarks over the years,” McConnell said during a September 2017 tribute to Donoghue’s 30-year anniversary in the Senate.

One of Donoghue’s crown achievements hit home, exposing the University of Arizona’s earmark for “shrimp aquaculture.”

This established McCain’s maverick band that, along with his eponymous campaign finance proposal, propelled him into a stunning blowout victory over the front-runner, George W. Bush, in the 2000 New Hampshire presidential primary.

Even though he eventually lost the nomination to Bush, McCain loyalists view the 2000 campaign as more fun than the successful 2008 GOP primary, when McCain claimed the nomination.

“We had a blast in 2000,” Donoghue said. He served as body man at McCain’s side in that campaign on the “Straight Talk Express” bus tours throughout New Hampshire and beyond.

Having lost his father at 14, Donoghue was well aware that he sought the senator’s approval the way a son reaches out to his dad. It was reciprocated.

“He’s like a son to me,” Cindy McCain, the senator’s widow, said in a mid-December interview. She brought Donoghue with her on the family’s vacation over the holidays.

But Donoghue got a firsthand look at the senator’s famous temper, because he worked such important issues, according to Mark Salter, the chief of staff until 2009.

“G-ddamnit, Joey,” John McCain would say, echoing through the office.

Once, Sen. Richard C. Shelby (R-Ala.), a longtime foe, began blocking every bill coming out of one of McCain’s committees, so the Arizonan ordered Donoghue to block every bill out of Shelby’s committee. He even blocked a bill creating a commemorative coin benefiting veterans — a bad look for McCain, a Vietnam War hero.

The senator acknowledged that he said “every” bill in a lecturing call to his aide. “Yes, Joe,” he said, “but I also hoped you could use a little common sense.”

Moving ahead, McCain gave more and more responsibility to his legislative director.

“I barked at you, teased you, laughed with you and counted on you. We’ve been through a lot of highs and lows,” McCain said during the 2017 tribute to Donoghue and told the Senate that he could not “imagine serving here without you.”

Donoghue’s toughest assignment came after McCain was diagnosed in July 2017 with glioblastoma, a deadly brain cancer.

Donoghue became almost a caretaker in the brutal grind of McCain’s final five months in Washington, walking a step behind him everywhere he went to make sure the frail senator didn’t fall.

“Joe was very protective of John, especially in these later years,” Cindy McCain said.

When John McCain left Washington for good, Donoghue and other senior staff kept younger aides focused on the job, writing statements on policy proposals, co-sponsoring legislation and holding near-daily conference calls with their boss back in Arizona.

Once a month, he trekked to the McCain home in Sedona, updating the senator and just spending time with him. “I felt like I said goodbye to him six times,” he said.

After McCain died in August, Donoghue served as pallbearer alongside several McCain children and close friends such as then-Defense Secretary Jim Mattis at the burial on the Naval Academy grounds.

Ready to leave the Senate, Donoghue agreed to serve four months as chief of staff for Jon Kyl (R-Ariz.) during his brief stint as McCain’s replacement.

The staff, made up largely of McCain aides, needed continuity with the past, Kyl said. “He is still devastated by the loss.”

After the holidays, Donoghue packed up his office in the Russell Senate Office Building for the last time, unsure of what comes next.

He just knows it is time to stop being the guy behind the guy.

“I need to learn who Joe Donoghue is without John McCain,” he said. “It’s time for me to do that.”