Rapper Kidd Creole stabbed and killed a homeless man in Manhattan because he thought the man was hitting on him, became infuriated that he was viewed as gay, and then feared the man would rob him, a prosecutor said in court on Thursday.

The former Grandmaster Flash and the Furious Five group member, whose real name is Nathaniel Glover, was charged with second-degree murder in the incident, which occurred on East 43d Street close to midnight on Tuesday.

advertisement | advertise on newsday

The incident started when the homeless man said, “What’s up?” a prosecutor said Glover had said in a statement.

Glover, 57, of the Bronx, admitted stabbing the man with a steak knife and later throwing it into a sewer, and area surveillance video showed the victim taking a swig of a beer after he was stabbed and before he collapsed, the prosecutor said.

The victim has been identified as John Jolly, 55. Grandmaster Flash and the Furious Five was inducted into the Rock and Roll Hall of Fame in 2007.