Abel Cedeno, a gay teenager who stabbed a fellow student to death at his Bronx high school and seriously wounded another in what he said was an act of self-defense, was found guilty of all charges Monday.

Cedeno, 19, has said he was bullied for years by his peers over his perceived sexuality. He came out as gay after his arrest. He was on trial for manslaughter, assault and criminal possession of a weapon.

He fatally stabbed Matthew McCree, 15, and seriously injured Ariane Laboy, 16, during a fight Sept. 27, 2017, in a history class at their high school, according to prosecutors.

Cedeno waived his right to a jury and placed his fate in the hands of a state Supreme Court judge in the Bronx.

McCree's death was the first homicide in a New York City school in two decades. It prompted protests from parents who said the school should have had metal detectors, and calls from LGBTQ advocates for the city to address the bullying of gay students.

Authorities said Cedeno walked into a third-period history class at the Urban Assembly School for Wildlife Conservation, a middle and high school in the Bronx that shares a building with an elementary school, and stabbed McCree and Laboy with a switchblade as about 15 to 20 other students watched.

McCree was stabbed in the chest. Laboy was stabbed in the chest and side.

Moments after the attack, the then-18-year-old Cedeno allegedly left the classroom.

Last week, Cedeno took the stand at his trial and said the fight and stabbing were the culmination of years of bullying he endured over his sexuality. He said Laboy, McCree and others were throwing pencils, pen caps and balls of paper at him the day of the stabbings.

Cedeno filed a federal lawsuit against the city Education Department last month, alleging the school enabled the bullying and that he endured “discriminatory anti-gay epithets," as well as physical abuse.

He was taken into custody following the verdict. His sentencing is scheduled for Sept. 10.

CORRECTION (July 16, 2019, 11:51 a.m. ET): An earlier version of this article misidentified the teenager whose death was the first homicide in a New York City school in two decades. It was Matthew McCree, not Ariane Laboy.