A man who allegedly stabbed a stranger with a kitchen knife after leaping across multiple subway tracks in Brooklyn was trying to stop an incident of racial harassment, police said.

According to an NYPD spokesperson, Bilal Abdullah, 52, ran across four sets of tracks at the Ralph Street station in Bed-Stuy on Saturday night. He then pulled a knife and stabbed a man in the torso and neck, who police say had used the n-word on a black man standing next to him.

"I crossed the tracks to confront the Spanish guy because I had to protect the black guy from this harassment," the defendant told police, according to court documents provided by the Brooklyn District Attorney's office. "I stabbed him, he fell and was bleeding."

The victim suffered multiple stab wounds and was taken to the hospital, where he underwent surgery for bleeding of the brain. A kitchen knife was recovered at the scene, and Abdullah was charged with attempted murder, assault, menacing and harassment, according to the complaint.

A judge denied Abdullah's request for bail during an arraignment on Sunday. He will undergo a psychiatrist examination ahead of his next court date on September 20th.