NEW YORK — The trial of rapper Kidd Creole has begun in New York City with his lawyer telling a jury it was self-defense when the hip-hop pioneer stabbed a homeless man to death in 2017.

The artist, a founding member of Grandmaster Flash and The Furious Five, is charged with murder and went on trial Friday in a Manhattan criminal court.

Prosecutors said the rapper, whose real name is Nathaniel Glover, stabbed John Jolly twice in the chest with a steak knife after becoming enraged because he thought Jolly was gay and hitting on him. The stabbing happened as Glover was walking to his maintenance job in midtown Manhattan shortly before midnight on Aug. 1, 2017, and Jolly asked him “What’s up?” authorities said.

“Ladies and gentlemen, this is New York City. It’s 12 o’clock at night. Who’s saying ‘What’s up?’ to you with good intentions?” Glover’s lawyer, Scottie Celestin, told the jury. “His fear for his life was reasonable.”

Celestin also said Jolly died from a dose of the sedative benzodiazepine that was given to him at a hospital, not the stab wounds.

Assistant District Attorney Mark Dahl told the jury Glover confessed to police and didn’t stab Jolly in self-defense, but rather in anger because he thought Jolly was hitting on him.

“The defendant confessed to pulling out a kitchen knife and repeatedly thrusting it into the body of a stranger on the street, killing him,” Dahl said. “Was there anything that would prevent him from simply running away from Mr. Jolly? No.”

Grandmaster Flash and The Furious Five is best known for their 1982 rap song, “The Message.” The group formed in the late 1970s in the Bronx and became the first rap act to be inducted into the Rock and Roll Hall of Fame in 2007.

The trial resumes Monday.