Shadow Mario is one of the primary antagonists in Super Mario Sunshine. In reality he is just Bowser Jr. disguised as Mario so that his opponent would be blamed for his wrongdoings. In the game, Shadow Mario would spread toxic goop across all of Isle Delfino, which in turn would cause all of the Shine Sprites to vanish. His plan works and Mario gets blamed, and is then ordered by a local judge to clean up all of the paint.
On multiple occasions, Mario will be required to hunt down Shadow Mario by spraying him with water, which is apparently is his weak point. He'll do this quite often on every stage, and in the game's hub world when he kidnaps Princess Peach and a lone Yoshi Egg. Shadow Mario also appeared as a playable character in the game Mario Golf: Toadstool Tour.
In Super Mario Galaxy, a minor character called Cosmic Mario appeared who looked strikingly similar to Shadow Mario. He only appears in four galaxies only when the cosmic comet is in orbit and only then he races against you to the star.