Cops: Justin Bieber's Security SCREWED UP

6/23/2011 5:10 PM PDT

Cops: Justin Bieber's Security SCREWED UP

Justin Bieber's security REFUSED to follow police orders today ... after an unruly mob nearly overran the singer and are to blame the ruckus that followed -- this according to law enforcement sources.

We're told Bieber deviated from a carefully planned route outside Macy's today -- where he was supposed to sign autographs for fans -- and the crowd nearly trampled him.

Law enforcement sources tell us a plainclothes officer jumped to save Bieber -- but as we previously reported, the singer's security didn't realize the guy was a cop ... and pulled him off.

According to law enforcement, the officer in question immediately identified himself -- but Bieber's security guard still refused to stand down ... so cops "secured" the guy and cited him for disorderly conduct.

Bieber wasn't injured and continued signing autographs once the situation was brought under control.