Bart wins a radio contest which allows him to choose between two prizes: $10,000 or an elephant. Bart picks the elephant and names him Stampy. Homer and Marge decide to give the elephant away because he costs too much to feed, so Bart and Stampy run away together.
Bart is listening to the radio and hears the announcers say that if the next person they call answers "KBBL is going to give me something stupid," that person will win a prize. Bart, hoping that he will be the next person called, answers the phone every time it rings saying, "KBBL is going to give me something stupid," with one of the callers being Grandpa Simpson having a heart attack. The KBBL guys eventually do call and Bart says the right thing and the announcers give him the choice of either winning an elephant or winning $10,000. Bart chooses the elephant over the money, not knowing that the elephant was not really a prize. Over the next few days Bart continues to demand the elephant and eventually gets it, mostly because the station announcers were going to be replaced by a mechanical DJ. Bart names the elephant Stampy, who freaks out Santa's Little Helper and Snowball II and has the habit of putting Bart in his mouth.
The family has mixed feelings about Stampy, with Marge and Homer not thrilled with the situation, but Lisa is more along the same side with Bart, at least when Homer is mistreating him, and Bart loves him. The elephant proves to be very expensive as it eats a lot of food. To offset food costs, Bart offers rides on Stampy for $2, but eventually accepts that Stampy's upkeep is too expensive for his parents to handle and looks at places that are able to properly accommodate him. One is donating Stampy to a nature preserve, which Homer immediately dismisses because he will not receive any money out of it. Eventually Homer decides to give Stampy to Mr. Blackheart, a man who is obviously an ivory dealer (decked out head to toe in ivory an even giving Homer an ivory cheque), when he offers a substantial amount.
In the lull on figuring out what to do, Stampy goes on a rampage through Springfield in the middle of the night. Wiggum doesn't believe the phone calls about the rampage, and the family is forced to look for Stampy alone. They eventually find him at the Springfield Tar Pits, brooding over a statue of a Columbian Mammoth and a Sabre Toothed Tiger trapped in the tar. Feeling relieved that they found Stampy, until Homer says he still plans to sell Stampy and have his teeth made into piano keys, much to the family's dismay, they do not realize that Homer has started to sink into the tar himself. He eventually does notice but his efforts to get out only make things worse. Stampy pulls Homer out of the tar after trying a previous time and saving Barney, who lights a cigarette and sets himself on fire, with very little notice. Homer then realizes that the best thing to do with Stampy, with a little prodding from the family, is to donate him to the preserve. Stampy quickly tries to take over the rest of elephants by head-butting them into submission, with the Park Manager saying that this may be for several reasons, or is just the equivalent of humans being jerks, since Homer is doing the same thing to him that very moment, angry that he still didn't get any money.