Call him the cop who took a bullet. Thousands of bullets.

That’s what Steven. C. Richter did for up to 30 years as a veteran investigator for the California Department of Consumer Affairs and a deputy for the San Bernardino County Sheriff’s Department. But he wasn’t decorated for valor.

Richter, 64, resigned both jobs in disgrace in 2015. He then admitted he’d been stealing thousands of rounds of ammunition and other items for decades, according to documents released under the state’s new police transparency law.

But even after authorities found more than 12,000 stolen bullets in his home, and even after Richter told investigators he traded his loot to a now defunct Inland Empire wholesale gun store in exchange for guns, he wasn’t charged with a crime.

How could that be?

Records show the San Bernardino Sheriff presented charges against Richter to the county District Attorney, who did not act on them. A spokeswoman for the DA said Wednesday the case was sent back to the sheriff because it was incomplete. It was never returned.

A spokeswoman for the Sheriff’s Department, Cindy Bachman, said no information on the case was available.

Consumer Affairs spokeswoman Veronica Harms said the department didn’t ask the state Justice Department to investigate because criminal charges are normally handled by the local district attorney.

A few years earlier the Consumer Affairs department had suspected Richter of trading stolen ammo for guns. But it dropped the matter because the gun store-owner was Richter’s friend and refused to cooperate, records show.

Richter did not return phone calls from this news organization requesting an interview, and there was no answer when a reporter went to his house Wednesday.

The lack of charges are “very perplexing,” said Stanford University Criminal Law professor Robert Weisberg, noting that investigators found significant evidence in Richter’s home and that he confessed to stealing public property.

“It would have been a pretty merciful decision to decline the prosecution simply because of the vast amount of ammunition and gunpowder he had stored up,” Weisberg said. “So, it’s really quite scary. One might think that a former sworn officer of the law should be held to a higher standard.”

Former U.S. Attorney for Northern California Joe Russoniello said the thefts Richter admitted to are “clearly embezzlement. This guy is a public employee.”

The case shows incredibly sloppy record keeping by the agencies that employed Richter, Russoniello said, adding that may explain the lack of criminal charges. “There are a lot of people who probably were breathing a deep sigh of relief that they weren’t taken to task for all of their failure to adequately supervise him.”

The ordeal only came to light this week as a result of the state’s new transparency law that gives the public a right to learn about police misconduct.

Consumer Affairs is the first state agency to release police disciplinary records under the new law, Senate Bill 1421. The state department released documents, despite Attorney General Xavier Becerra’s declaration that his Justice Department won’t release its own disciplinary records until the courts settle police union lawsuits claiming the new law does not apply to records from past years.

Richter worked for an obscure state agency, the Department of Consumer Affairs Health Quality Investigations Unit, which conducts investigations for the state medical board.

Records show he first became a deputy sheriff in 1979 and moved to Consumer Affairs 20 years later to become an investigator for Consumer Affairs. He then became a reserve deputy for the sheriff. Richter was a range master and firearms instructor for both agencies.

Richter’s ruse began unraveling late on Dec.15, 2014, when he crashed his state-owned car into a power pole in Redlands. He then drove home, where an officer who tracked him down said he appeared drunk. He was eventually charged with misdemeanor hit and run. But the case settled without a conviction, and prosecutors dismissed the charge.

Consumer affairs began its own investigation and questions arose because Richter had told police he’d been at the county gun range long after it closed, raising suspicions. Eventually, a few weeks after the accident, Richter quit. State investigators twice went to his home and found guns, dozens of boxes of shotgun shells and thousands of bullets, some scattered around the house.

Finally, on Jan. 22, 2015, Richter called the sheriff’s department and admitted he’d been stealing ammunition and other equipment “over the past 20-30 years,” according to records When deputies went to his home, “Richter said he was ashamed of himself…and that he should be arrested.” But he wasn’t. “He was distraught and convinced his actions would bring great embarrassment upon himself, his family and his employers.”

Staff writer Tony Saavedra of the Orange County Register and Alex Emslie of KQED News contributed to this story.