A top auxiliary cop is facing a decade behind bars after he was caught hacking into NYPD traffic safety computers and an FBI database -- and then posing as a phony lawyer to make money off victims who had been involved in traffic accidents, the feds say.

Yehuda Katz, 45, was arraigned in Brooklyn federal court Tuesday and ran from waiting reporters after his release on a $75,000 bond. He was suspended from his volunteer role as an Auxiliary Deputy Inspector in the 70th Precinct in Brooklyn’s Kensington section.

It was the access he had in that role that set the computer tamper scheme in motion, the feds say, and allowed him to hack into law enforcement computers 6,400 times.

He installed devices that let him “remotely log onto an NYPD computer using usernames and passwords belonging to NYPD uniformed officers,” the feds said in court papers.

“Thereafter, the defendant ran thousands of queries in databases, including a restricted law enforcement database maintained by the FBI, for information, including the personal identifying information of victims, related to traffic accidents in the greater New York City area.”

Then he contacted the victims and claimed to be with the fictitious “Katz and Katz law firm,” which he said could help with any legal claims.

The feds say he sent letters to victims and included claims such as “I can advise you with 100% confidence that I can resolve this claim in your favor,” and “My fee is 14% only when you collect. And I know that you will collect.”

“The defendant allegedly used his position as an auxiliary officer to hack into restricted computers and networks in order to obtain the personal information of thousands of citizens in a scheme to enrich himself through fraud,” Brooklyn U.S. Attorney Lynch Loretta Lynch said.

“The threat posed by those who abuse positions of trust to engage in insider attacks is serious, and we will continue to work closely with our law enforcement partners to vigorously prosecute such attacks.”

The hacking took place between May and August 2014 and about 70 victims responded to his letters. If convicted, Katz  faces a maximum sentence of 10 years.