Lil Pump flew a little too close to the sun and got burned -- he taunted police officers in Denmark, on camera, got his ass locked up and had to cancel a gig ... TMZ has learned.
Sources close to the rapper tell us ... cops in Copenhagen detained him and his crew Tuesday for an unknown reason. We're told someone in the group was holding something illegal.
As they were being hauled to the police station, Pump busted out his phone and began live streaming and flipped a bird behind an officer's back. We're told the cops found out and decided to detain him much longer.
As a result ... LP's concert Tuesday night in Finland's been canceled. The Live Nation website for the show says it's due to "unexpected events."
Our sources say Pump's expected to be released in the next 24 hours. So far, he hasn't been hit with any criminal charges.
The rapper's run-in with cops comes just 3 months after he was arrested in Miami. He was also arrested earlier this year for firing a gun into the door of his L.A.-area home.