Maroon 5's Adam Levine was hit with powdered sugar prior to his performance on Jimmy Kimmel Live! Wednesday.

According to the LAPD, Levine was in a parking lot outside the studio signing autographs for fans when a man in his mid-30s attacked him and four others with the sugar bomb. Security detained the guy until cops arrived.

Ironically, during his appearance, Levine not only chatted with Kimmel about past scary run-ins with fans -- like a recent incident at a concert that left him with a cut ear, the band performed their new song "Sugar"!

Fans at the scene hit up social media with pics of the aftermath ...