Disgraced sex-assault cop Michael Pena pleaded guilty to rape today in a deal that will allow his schoolteacher victim to avoid a retrial for rape-related charges.

Morose-looking Pena, cuffed and wearing an orange prison shirt and pants, mumbled “guilty” four times to two counts of rape and two counts of predatory sexual assault.

Pena had to cop to his monstrous conduct in open court.

“Is it true you engaged in sexual intercourse with the complaining witness and you did with forcible compulsion?” Manhattan Supreme Court Justice Richard Carruthers asked.

Pena mumbled “yes” to that question and other queries about the gunpoint rape last June 10. He admitted that he penetrated his victim’s vagina.

Pena’s courageous victim sat in the second row, wearing a smart, cream-colored sleeveless dress as she stared down her attacker. She never shed a tear, and looked confident but relieved to end this proceeding.

Pena’s parents sat stoic on the other side of the courtroom.

Carruthers said he agreed to a deal that will “spare the complaining witness … of having to come to come to court and testify in retrial.”

“Michael Pena took responsibility for his violent criminal actions and will serve up to life in prison,” Manhattan DA Cyrus Vance said.

“This plea spares the victim from testifying again about the crimes committed against her, and it is my hope this resolution brings a brave young teacher a measure of justice and closure.”

Pena also didn’t want to rehash his horrific act.

“He doesn’t want to go through this again,” said defense lawyer Ephraim Savitt. “There’s closure to the case and there won’t be another trial with the victim and her family going through it again and his own family going through it again.”

In return for his plea to rape, Pena agreed to a sentence of 10 years to life in prison, but that number is virtually meaningless.