The firing of FBI Deputy Director Andrew McCabe days before his retirement was a rare case of justice.

Both the Justice Department inspector general and the FBI’s Office of Professional Responsibility found that “McCabe had made an unauthorized disclosure to the news media and lacked candor—including under oath—on multiple occasions.” Even one Democratic politician conceded that McCabe’s firing “may have been justified.”

But in the federal bureaucracy, very few people who deserve to be fired actually are.

Firing government employees is an onerous process. It requires investigations, counseling sessions, appeals, union arbitrations, and court hearings, all of which can take years. Managers are more likely to simply look the other way than go through the firing process.

Even for the most egregious offense, the minimum time it takes to complete the process is 270 days. As a result, many disreputable federal employees are able to beat the clock and keep their pensions.

Here are a few famous examples:

1. John Beale

Beginning in 2000, eight years before he was eligible for retirement, Beale, a senior official at the Environmental Protection Agency, began telling his boss he was moonlighting as a secret agent to get out of work. He would leave his job for as long as 18 months at a time—adding up to two and a half years in total—claiming to be on top-secret missions to Pakistan while actually heading off to his vacation house in Massachusetts.

When he did travel for his actual job, Beale ensured that he traveled in James Bond-esque style by claiming to have lumbar problems that required him to be seated in first class.

While Beale did time for his numerous crimes, he retired in 2011 before he could be fired and, to this day, receives a full pension for his brave service.

2. Lois Lerner

Lerner became infamous when she used her position as director of the exempt organization unit at the IRS to bully conservative tea party groups applying for tax-exempt status.

In 2010, at the peak of tea party activism and just ahead of the midterm elections, she instructed her team to flag applications with the words “tea party” and “patriot” in their names. Not only were such groups asked to fill out long and intrusive questionnaires about their activities that are not ordinarily required, they were ordered to hand over their donor lists—something 501(c)(3) nonprofits are permitted to keep private.

This was not the first time Lerner targeted conservatives. While at the Federal Election Commission, she opened multiple investigations against Al Salvi, a Republican Illinois state representative, all of which were dismissed.

Salvi recounts that in the midst of one such investigation, Lerner told him: “Promise me you will never run for office again, and we’ll drop this case.”

Once Lerner’s partisan bias was publicly revealed and Congress began to investigate, Lerner pled the fifth and then retired. Her full benefit package remains intact.

3. ‘Employees A and B’

Two EPA employees, referred to as “Employees A and B” in a House Oversight Committee report, shared not only a workplace, but an all-consuming passion for pornography.

After 7,000 pornographic files were discovered on Employee A’s work computer, he confessed to spending about two to six hours of each workday enjoying this voluminous collection.

Employee B was somewhat less libidinous—watching only about one to four hours of porn each day on average—but was far less discreet. A child uncovered his dirty habit as he was watching a pornographic video during Bring Your Daughters and Sons to Work Day.

While Employee B was terminated, Employee A had been on the job long enough to retire with a full pension before he could be fired.

Since he has not been publicly identified, it is impossible to know whether he began amassing his enormous pornography collection before or after he was eligible for retirement. But Rome—or, better yet, Gomorrah—was not built in a day.

4. Jeffrey Neely

Neely, once a regional commissioner for the General Services Administration, cost taxpayers millions of dollars by repeatedly submitting “false and fraudulent charges.”

Neely was chiefly responsible for organizing a lavish conference in Las Vegas that cost over $820,000 for 300 attendees. The budget for this bacchanal included $6,325 for commemorative coins, $3,200 for a professional mind reader, and multiple 2,400-square-foot suites that contained flat-screen televisions and a wet bar for top-level managers.

Neely also put vacations to Los Angeles, Guam, and Saipan for both himself and his wife on the federal government’s tab.

Neely was eventually indicted for five felonies related to these and other incidents going back over a decade. He pled guilty to one such charge (after confessing, the other charges were dropped) and served three months in prison.

He has since retired to Nevada, where he presumably can take regular trips to Las Vegas thanks to the continuing largess of the American taxpayer.

5. Susan Taylor

The Department of Veterans Affairs was a wellspring of scandal even before revelations that hospital administrators were falsifying records to conceal long patient wait times.

In 2010, Taylor, then serving as a procurement officer at the department, helped her married boyfriend’s company, FedBid, win a lucrative government contract. When a co-worker began to suspect something was amiss and the VA’s Office of the Inspector General subpoenaed FedBid’s internal records, Taylor pleaded with them to drop the case and started working with FedBid to develop a legal strategy to stymie the investigation.

This was not the only illegal favor Taylor did for her lover. Earlier in her career—and long before she was eligible for retirement—she attempted to shepherd him into the department she was working for at the time, which violated Office of Personnel Management policy.

When all this finally came to light, Taylor resigned and retired with her pension intact.

It Pays to Beat the Clock

In these cases and others, federal employees who manage to hand in their retirement notice before their misdeeds catch up with them are richly rewarded.

Federal employee retirement benefits are significantly more generous than those received by most private sector workers. Federal employees like Neely, Taylor, and Beale not only continue to get full health care coverage with tiny premiums and copays, they also continue to get a sizable annuity worth as much as 33 percent of their final paycheck in perpetuity.

McCabe, on the other hand, stands to lose hundreds of thousands in retirement benefits.

Fortunately for McCabe, he is only 49 years old. The average American doesn’t retire until 66, so he has plenty of time for a second career.

Note: This article has been corrected to note that Andrew McCabe will lose many of his FBI retirement benefits, not all of them.