"Just did a voice over for the SIMPSONS!!! #swaggy," the 18-year-old's message said before he deleted it.
Bieber's Twitter account is the microblogging service's second most popular celebrity account after Lady Gaga's, with more than 27 million followers.
Simpsons Executive Producer Al Jean told Entertainment Weekly the "Boyfriend" singer superstar would play himself alongside Homer and the gang in an episode titled "The Fabulous Faker Boy" that involves music.
"He tries to get into a talent show that Bart is playing piano in -- and they won't admit him," Jean said before quipping, "Draw your own conclusions."
The episode's title is a play on the 1989 romantic drama musical film "The Fabulous Baker Boys," starring real-life brothers Jeff Bridges and Beau Bridges as two brothers struggling to make a living as lounge jazz pianists in Seattle.
Bieber's role is "a cameo," Jean noted, suggesting fanatical Bieber devotees known as "Beliebers" should not expect too much -- "but all of his fans should watch every minute of the show, before and after he's on."
Fox did not say when the episode would air, but Entertainment Weekly and E! News said it would be next year.
The series begins its 24th season Sept. 30.
Members of Congress to keep receiving porn magazine
Justin Bieber crashes Drake Bell's album release party