I investigate a bit I realized that this happened in the first season of Pokémon anime, but still… HOW?!?!?!?!?!?!?! While I was making this Harry Potter theme earrape sounded in my head.
Episode 32 (The Pirates of Decolore!), 16th season (Pokémon BW: Adventures in Unova)