A Brooklyn teen admitted Wednesday that he stabbed his father to death in 2015 but said he did it following years of sexual and physical abuse.

Hassan Razzaq confessed to the fatal knifing following his guilty plea in Brooklyn Supreme Court to first-degree manslaughter. As part of the deal, the 22-year-old will be sentenced to five years behind bars.

“My father had been abusing my sisters and my mom, for as long as I can remember,” the 22-year-old told the court quietly. “He came home and continued with the abuse, so I killed him.”

Razzaq knifed his father, Mohammed Razzaq, after he returned unexpectedly from a trip to Pakistan, and began beating one of his sisters, he said.

“You stabbed him with a knife?” Justice Vincent DelGiudice asked Razzaq during the plea.

“Yes,” he grunted, looking down at the table.

“You wanted to hurt him pretty badly, but you didn’t want him to die?” the jurist asked.

“Yes,” Razzaq replied, still hanging his head.

None of the young man’s family were in court for the plea.

“He’s relieved,” defense attorney Michael Cibella said after the plea hearing. “He’s certainly relieved to have this matter closed, and to know that he will be free.”

“This is someone who’s been a victim his entire life, and has a great deal of healing to still go through,” the lawyer said, sighing. “His entire life he was witness to and subject to horrific abuse.”

Razzaq is scheduled to return to court Sept. 26 for sentencing.