The story revolves around the Millennium Comet, which appears in the night sky for seven days once every thousand years. It is, at the same time, when the legendary Pokémon Jirachi awakens from a long slumber to absorb the comet's energy. This energy, in turn, is released into the Earth itself, making an area known as Forina grow. This time, however, a magician known as Butler, along with his longtime girlfriend Diane, unearth the stone that had encased Jirachi, and take it away from Forina.
Meanwhile, in celebration of the Millennium Comet appearance, Ash Ketchum and his friends arrived at a wide crater, which is where the festival of the Millennium Comet is meant to be. They then decide to wait until morning and go to sleep. While they're sleeping, the festival arrives; Pikachu, Ash's companion, wakes up and wakes all the others, and they watch the festival being set up.
At the festival, May buys a seven-panelled novelty that is said to grant a person one wish if a panel is closed for each night the comet appears and is visible in the sky. When Ash and Max accidentally volunteer for one of Butler's magic tricks (because Max hears a voice coming from the rock Diane is holding and runs down to the stage), Max is introduced to Jirachi, who he hears talking from inside the rock. Butler lets Max take the rock, which hatches into Jirachi later that night. Hoping the wishing ability was true, Max wishes for candy, lots of candy, and it appears—but it is revealed that instead of creating the candy, Jirachi teleported it from a stall in the festival.
The intentions of Butler are soon revealed: he was a former scientist for Team Magma who was seeking to resurrect the legendary Pokémon Groudon. Butler had devised the perfect system, but could not find the necessary amount of power; to this end, he had hoped to use the energy Jirachi absorbed for his own purposes. Seeing this danger, the Pokémon Absol, whose presence usually indicated impending disaster, takes Diane and Jirachi, along with Ash and friends, back to Forina. Unbeknownst to them, Butler had set a trap once they returned to where Jirachi was found, and manages to capture Jirachi.
Butler attempts to harness Jirachi's power, but is interrupted inside the tent by Ash and his friends. With the help of Diane, they take Butler's bus to Forina so that Jirachi can go home; unknown to them, Butler's Mightyena places a tracking device on the bus as it is leaving. As Ash and his friends travel along bumpy terrain, the device falls off, but Butler still discovers where they are headed. Before the day Jirachi has to return Max feels upset about losing a friend so Ash tells him about one of his friends Misty and that even though they don't see each other anymore they will always be friends. But before they make it back to Jirachi's home they realize that Butler had followed them there; once again steals Jirachi, and tries to take its power again.
When Butler sets his plan in motion, however, a fake Groudon is created instead, and begins to turn Forina into a wasteland, absorbing the energy from the earth, killing all the plants in sight and absorbing all living creatures. When Diane is absorbed by the fake Groudon, Butler realizes his longtime relationship with Diane is what was important, and with Ash and Max's help he is able to reverse the process, causing the fake Groudon to meltdown and die.
Eventually, Jirachi reabsorbs the energy used to create Groudon, and leaves for another thousand years of slumber. May, in all the excitement, forgets to close the last panel of her novelty, but simply brushes it off. Though she never reveals just what she wished for, she is confident it will come true.
During the end credits, May gets tired of walking until the man who sold her the wishing star gives them a lift with his truck. Then they look at stars, which form Pokémon from Teddiursa to Pikachu. After that they all watch the festival fireworks.
- The storyline continues in Little Bear's Adventures of Pokémon: Destiny Deoxys.