Gays of the world rejoice -- Justin Bieber was partying at a gay bar!

The superstar singer was spotted drinking at a gay bar in North Hollywood on Saturday night. Apparently the “Sorry” singer dropped by the man-friendly spot, Club Cobra, with some dudes.

Some outlets are reporting that the club's bouncer said the popstar may not have known it was a gay bar since no other patrons were there — only a bartender and staff. But our pics make it quite clear that the Biebs knew he was going into a hot sexy mancave -- and didn't do it alone. Look at that treasure trove of rainbow flags -- there's no way he didn't know he was in a gay bar!

JB left the boozy boy bar around 10 PM, before hitting up a party at 1 OAK and giving an impromptu performance.

Too bad JB didn't stay longer -- we have a feeling things were just about to heat up!