The Miami Beach PD is investigating its own ... after a female cop tried to take a pic of Justin Bieber behind bars ... TMZ has learned.
Law enforcement sources tell TMZ ... while Justin was in jail last week in Miami Beach -- being processed for DUI and resisting arrest -- a patrol officer showed up and made her way to the area where Bieber was being held.
We're told the officer had no business being in the area ... and had no connection to the arrest.
Our sources say ... a Sgt. noticed her pulling out her cell phone, attempting to take a pic of Bieber. We're told the Sgt. jumped in front of the officer and blocked the shot.
The Sgt. ordered the officer out of the area and she left.
The Sgt. wrote the officer up for "conduct unbecoming an officer" -- which triggered an internal affairs investigation.
We're told her punishment could range from an admonition to termination.