A Bronx man accused of fatally stabbing a 17-year-old — the day after the accused killer was freed from jail on domestic violence charges — claimed his abused girlfriend killed the teen to “work on” their relationship.

Jose Mendez, 40, had a cast on his right arm and a bruise around his right eye when he appeared in Bronx Criminal Court on murder charges Thursday. Prosecutors said the accused killer told police that his 25-year-old girlfriend Rosanna Castro did it.

“Roseanna started stabbing the girl while I held her by the neck,” Mendez said, according to a statement read in court. “She told me to get two garbage bags and we could put her on the roof and no one would find her. She said she wanted to start again working on our relationship.”

Mendez — not Castro –is accused of stabbing Luzbenet Ramirez more than 30 times around 3 a.m., last Friday, one day after he got out of jail for beating Castro.

Police said the convicted woman-beater later confessed to killing the straight-A student because Mendez thought the teen had an affair with his girlfriend while he did 35 days for assaulting the girlfriend.

Mendez was sent to jail Thursday without bail. He is due back in court Nov. 1.