“I’m a persistent felon and I can only get 12 years to life,” he complained.

Actually, prosecutor Samuel David told a Manhattan judge today that Martinez — a persistent violent felon — faces a maximum of 20 years to life, meaning under that sentence he wouldn’t see a parole board for two decades.

The first robbery happened on Nov. 22 inside 2 Peter Cooper Road, in Peter Cooper Village, where Martinez allegedly cornered woman in her elevator, pulled out a knife, demanded money and left with $700 cash, according to prosecutors.

On Dec. 2 came three separate incidents.

The first was an attempted robbery in an apartment lobby at 521 East 14th St. — in which the woman sensed something strange about Martinez and refused to get inside despite his urging her to, said prosecutors. Martinez was charged with burglary for that incident..

A half hour later, in a Stuyvesant Town elevator at 17 Stuyvesant Oval, Martinez allegedly pulled an ice pick on a woman accompanied by her three-year-old son — and threatened to stab the child if his mom didn’t take him back to her family’s apartment for more money.

That terrified victim was able to push their way into their apartment without Martinez gaining entry.

In the third Dec. 2 incident, just five minutes later, Martinez entered an apartment building at 525 East 14th St. and again got on board an elevator holding a woman and her two small children. He allegedly pulled the ice pick out again and demanded cash and jewelry. The victim gave up her wallet and ring.

Martinez was indicted yesterday in The Bronx on two elevator robberies of middle-aged women, one at knife-point and the other at pick-point and both captured on security video.