Matt Groening has confirmed that Michael Jackson did provide the voice (under the name John Jay Smith) for Leon Kompowsky. He did not do any singing which was done by an impersonator. Jackson wanted an impersonator to sing because he wanted to fool his brothers into thinking the impersonator was him. Jackson did record himself singing but the tracks were not used.
Michael Jackson called Matt Groening and requested to voice a character on the show. He was a big fan of Bart and promised to write a number one song for him. The song he wrote, "Do the Bartman", reached number one in many European countries in 1991.
A sequel episode was written in which Leon Kompowsky would be voiced by Prince, who was Michael Jackson's musical rival at the time. But Prince disliked the script backed out and the episode was not produced.
This was the second time that a major celebrity guest appeared on the series. The first was Dustin Hoffman who appeared in "Lisa's Substitute" credited as "Sam Etic". Following Jackson's use of a pseudonym, the producers no longer allowed celebrities to use fake names.