A recidivist robber and subway sex offender released from jail earlier this summer has been busted — and police want to keep him out of the system for good, a high-ranking NYPD official said Wednesday.

Santiago Gonzalez, 71, was arrested Tuesday after trying to steal cash out of a straphanger’s front pocket on a Manhattan subway, according to cops.

“We knew he was out of jail in June, and we’ve been keeping eyes out for him ever since,” Chief of Transit Edward Delatorre told The Post Wednesday.

Gonzalez is a level-three sex offender who has been arrested 27 times — including 24 times in transit — but keeps coming back. Delatorre talked about him at a recent MTA board meeting — referring to him as Mr. G.

”He was arrested on March 14 for persistent sexual abuse and spent 97 days in jail and got out in the end of June,” Delatorre said.

Sgt. Michael Dennis said he arrested Gonzalez around 4 p.m. Tuesday after seeing him try to pickpocket a man on the 4/5/6 subway line.

“He’s closely behind the victim, and he’s coming onto the train,” Dennis said. “He bumps him to check for a reaction, the male did not react. He takes his right hand and pushes it into the victim’s right-hand pocket.”

On his first attempt, Gonazalez got nothing. Then, he went back in a second time and grabbed cash.

“This time the victim realizes what’s going on and reaches down and grabs Santiago’s hand,” Dennis said.

Shortly after that, Dennis cuffed Santiago and placed him under arrest.

Delatorre has backed a ban on subway recidivists and said Gonzalez is a prime example of a person who should be kept out of the system.

“Aside from victimizing many people with his grand larceny, he also victimized many people in sex assaults, including underage kids,” the chief said, noting that Santiago’s last arrest for sex abuse of a child was in 1997. His last sex offense on the subway was allegedly against a young woman on March 14, officials said.

“We can’t keep doing the same thing and getting the same results,” Delatorre said. “At some point, we have to step up and exclude someone like this. How is it that he can’t go near a school where children are but he can ride the train with them?”

Gonzalez was awaiting arraignment as of Wednesday evening.