A pair of teens allegedly attacked and robbed a 28-year-old man while yelling gay slurs during a drug deal gone bad in Brooklyn, sources told The Post.

The encounter happened just before 11:30 p.m. Saturday when the man met the two 16-year-olds behind 149 Martin Luther King Jr. Place in Bedford-Stuyvesant neighborhood, according to police and sources.

The man tried to call off the deal when he was asked if he was interested in men — but one of the teens jumped him, putting him in a headlock, the sources said.

The teen hit the man multiple times, calling him a “f—t,” and took off with his cell phone and wallet, according to police. The man has multiple bruises on this back but was not hospitalized, cops said.

It was unclear what drugs he was trying to pick up.

The Hate Crime Task Force investigated the encounter and collared the two teens on Sunday, police said. The teens’ names were not released because they are minors.