EXCLUSIVE

Famous Dex got arrested Thursday in NYC because he was in the wrong place at the wrong time ... and also because he was already a wanted man.

Law enforcement sources tell TMZ ... the rapper was busted in Manhattan on an outstanding warrant stemming from missing a previous court date for a public drinking violation. Now, the wrong place, wrong time part ...

We're told Dex was initially nabbed at the Royalton Park Avenue hotel with a group of people cops were investigating for credit card fraud. When they ran his name, the warrant for his arrest popped up.

Our sources say the rapper was also cited for marijuana possession. He was not charged for anything related to the alleged credit card fraud committed by the other people in the hotel room.

We're told Dex is being transferred to the Bronx to see a judge about that outstanding warrant.