Former NYPD Chief of Department Philip Banks abruptly retired to avoid a background check that was part of his planned promotion to first deputy commissioner, The Post has learned.

“He figured out that in order for him to go from a four-star uniformed officer to a four-star civilian, he’d have to go through a background investigation,” a source familiar with the matter said Monday.

“That’s what caused him to pull his papers.”

The source spoke hours after The Post revealed that Banks’ surprise retirement came a day after a judge approved a FBI wiretap that was part of a sprawling investigation in which the feds found more than $300,000 in “unexplained” cash deposits into Banks’ accounts.

Banking records also showed he had received more than $245,000 in rental income from two Queens properties — but didn’t report that money or the cash to the IRS, according to an FBI affidavit filed in Manhattan federal court.

The source said Banks didn’t want to go through a background check by the Department of Investigation “for obvious reasons.”

“He would have to disclose all his financial relationships, documents on all the property he owned. That all would have been explored,” the sources said.

At the time he quit, Banks publicly claimed it was because the new job “would take me away from where I could make the greatest contribution: the police work and operations that I love so much.”

But in an interview Monday, Banks, who is black, said the real reason was because then-Police Commissioner Bill Bratton’s “old-boy network” was “all white males” — and the top cop wanted “a local black just to color him.”

“He was using me,” Banks said.

“This n—-r was going to be his f–king puppet. I saw this act before.”

The job of first deputy commissioner went to Benjamin Tucker, who is also black.

Banks — who began shaking uncontrollably and was on the verge of tears Sunday when The Post asked him about the FBI investigation — also said he told Bratton he’d only take the post if Bratton gave him authority over the chief of department.

Traditionally, chiefs of department report directly to the police commissioner, but Bratton made an exception when the late John Timoney, who was white, served as his first deputy commissioner.

Banks — who was never charged with any crimes by the feds — also adamantly denied that he quit to avoid a probe of his finances by the city Department of Investigation.

“I beat the IRS investigation, the US Attorney investigation and the FBI investigation. They found nothing. Why would I be concerned about a DOI investigation?” he said.

“I would have passed that DOI bulls–t investigation.”

Bratton didn’t return messages seeking comment.