Forty years ago

A young Pokémon Trainer named Sam is traveling through the woods one day. A young woman named Towa gives Sam a piece of bread and a warning: that there is a rare and powerful Pokémon living in the forest. Sam thanks her for the bread and continues into the deep woods, where he begins sketching some Bellossom, unaware that elsewhere in the same forest, a Celebi is being chased down by a Pokémon Hunter who wishes to capture it using his Scyther and his Houndoom. Celebi, the Hunter, and Sam soon come in contact with one another, and Sam protects the Celebi from the man, who reveals himself to be a poacher of rare Pokémon. Celebi is still worried and in pain, however, and teleports both itself and Sam into the future.

Present day

In a caravan by the forest the same Pokémon poacher, now aged, is in a confrontation with the Iron-Masked Marauder, a member of Team Rocket, who wants to know where he saw Celebi. The poacher refuses, and therefore the Iron-Masked Marauder demonstrates a Dark Ball, using it on one of the Pokémon the poacher has caged up, a Tyranitar. Using the now Dark Tyranitar's Hyper Beam, the Iron-Masked Marauder destroys the ranch, and apparently the cages, of the poacher. Finally convinced of the Rocket member's power, the poacher agrees to tell him everything he knows about Celebi.
At the same time, in a nearby town, Brock and Misty are waiting for Ash to arrive at the dock of one of the many ferries they've taken across the waterways of the regions. Brock sends out his Crobat to find Ash and tell him that it's just about time for them to leave, just as Ash starts a Pokémon battle with another Trainer, using his Pikachu against the Trainer's Croconaw. Pikachu defeats Croconaw easily, just as Crobat shows up, and Ash and Pikachu make a run for the dock, arriving just in time to see the ferry begin to pull away. Ash runs for a dock nearer to where the ferry is, jumping for it and being caught by Mr. White, the boat's owner. After being dragged on board, the Trainers and owner talk Pokémon.
It is during this that Pikachu sees another Pokémon in the forest, Suicune. As soon as they arrive at their next destination, Ash makes a call to Professor Oak, who explains to them from Ash's description that it indeed was a Suicune. From the description Professor Oak gives the young Trainers, it seems that Oak himself knows more about Suicune specifically than the experts, leading Ash to ask if he ever has seen one. The Professor replies affirmatively, and Ash asks where he did. Before Oak can reply, the ferry's owner calls for Ash, telling him that they must leave. Ash says goodbye quickly, and goes with him.
Ash continues on the water, this time in a different boat, through a deep forest, and, as always, JessieJames, and Meowth are watching. This time, their preferred mode of transport is seemingly a giant pink paper airplane, the propeller in the back of which is operated by the pedaling of the Rocket trio. However, Jessie stops pedaling for a moment, leaving the contraption underpowered and susceptible to the wind, which is exactly what catches it. Team Rocket are sent flying into the distance, leaving their trademark star in the sky.
Meanwhile, Ash, as well as the others, have reached a waterfall along the river. Unable to climb it, Misty asks what they'll do. Mr. White responds with a quick transformation of his craft, turning it from a boat into a small blimp in a matter of seconds, and floating up, over the waterfall, and into Arborville which a small town comprising entirely of tree-houses, where he lets the Trainers off.
They continue on, arriving at the same place that Sam did forty years before and are asked by Towa, who has now aged considerably, if they're going to be going into the forest to look for Pokémon. Ash replies that he will and soon the old woman's granddaughter, Diana, shows up, who Brock promptly hits on. Ash ignores Towa's advice, running headlong into the forest, leaving Misty to pull Brock away from Diana, as she always does.
As soon as the trio has gotten into the deep woods, the trees begin to glow blue, something that happened just before Celebi vanished into the future with Sam. At the same place he vanished from, in front of Celebi's shrine, Sam reappears just as Ash, Misty and Brock run up, with Celebi in his arms. Celebi floats away before the three can see it. Sam is unconscious and Ash, worried about him, decides to take him back to Towa's house.
As soon as the four return, Sam wakes up, pushing Ash away and demanding where Celebi has gone. Before there can be a fight between Ash and Sam, Brock is able to break it up. Towa suddenly recognizes Sam, and she brings everyone inside to explain what happened. Since Sam disappeared 40 years before, she had been keeping his sketchbook, and returns it to him explaining to him just how long he'd been gone.
Sam vows to return to where he reappeared and find Celebi to help it, and Ash, Misty, and Brock agree to go with him.
Soon, traveling in the forest, the four see the destruction wreaked by the Iron-Masked Marauder's giant mech, and Sam and Ash find where Celebi is hiding. However, the Time Travel Pokémon appears not to want their help, sending out vines to get them away. Pikachu prepares to ThunderShock it, but Sam prevents it from doing so. Soon, Ash and Sam are able to, together, soothe Celebi and bring it with them.
Team Rocket, not yet having given up, are waiting for them, and block their path back. Saying their motto, as they always do, causes Wobbuffet to fall down onto the already-unstable branch they stand on, though, and causes it to break, sending them to the ground, and allowing the four Trainers to continue.
Just as Ash says that the town where the old woman and Diana live together is close, the Iron-Masked Marauder attacks, sending out his Dark Tyranitar against the Trainers. Using its Hyper Beam again, he very nearly hits them, however, they are able to escape, partly due to the intervention of Weezing's SmokeScreen. It is at this point where all of the Team Rocket members meet. the Iron-Masked Marauder demonstrates to them his Dark Pokémon, sending out his Dark Sneasel and Dark Scizor as well, and sends the two Pokémon after the group of four.
Misty causes the group to stop due to twisting her knee, and both of the Dark Pokémon catch up. Ash prepares to battle, taking out one of his Poké Balls, and Sam does as well. Sam's Poké Ball is different, though; instead of being a red-and-white color like Ash's, it has a grayish color to it, and must be unscrewed on the top before sending out his Pokémon of choice, a Charmeleon. Ash, now over the surprise of Sam's strange Poké Ball, throws his own, sending out Bayleef. Thus begins a battle, Bayleef vs Scizor, Charmeleon vs Sneasel. Both of the Trainers' Pokémon are able to defeat the Marauder's, just as the man himself, with his team-mates, arrives. However, all he finds left by the Trainers are his Pokémon, tied up.
Ash and the group continue in the forest, which grows foggy. Leading them through are several Normal-type Pokémon, who bring them to a lake, called the Lake of Life. Sam brings Celebi in, and it dives underwater, using Recover. Now fully healed, the Pokémon plays with the group a bit, and Ash turns his hat backward and jumps in, followed by Sam. The three of them swim for a bit, then fly through the air with the help of Celebi's Psychic powers. Celebi soon leads all four of them to a Berry tree, and everything seems well for a bit.
Jessie, James, and Meowth, bored on the Iron-Masked Marauder's mech, try to grab a fruit of their own, however, in doing so, they end up falling out, and even losing the fruit itself to a Pidgeotto.
Back with Ash's group, he and Sam are discussing Pokémon, and Sam shows Ash his sketchbook, containing several excellent drawings including the one that Sam is working on now... one of Pikachu and Celebi sleeping together. Ash remarks on the quality of Sam's pictures, which Ash compares to a Pokédex. The two then talk about how, especially for Sam, that their mothers must worry about them. Pikachu and Celebi then wake up and run off, causing Sam and Ash to follow them. Climbing a tree, they watch many Metapod evolve into Butterfree and fly off creating a magnificently colorful display. The two friends watch this together with the Pokémon, and marvel at the amazing and unforgettable sight.
The next morning, the four Trainers continue their journey back to the village when the Iron-Masked Marauder arrives on his mech. With Jessie, James and Meowth cutting off their escape, the gang are forced to try to fight their way out. Pikachu's attacks do not damage the mech, and the Iron-Masked Marauder captures Celebi in his Dark Ball. Ash attempts to attack the Iron-Masked Marauder himself and climbs the mech's leg, as a swarm of Pidgey surround the Marauder allowing Ash to make it up. However, even though his efforts are able to topple the mech and is able to get the Dark Ball containing Celebi away, the evil Team Rocket member is able to get it back when Ash loses consciousness. He then shows the group, as well as the Pokémon who have gathered to help Celebi, just what has happened: Celebi has become a mindless monster who instantly attacks with its psychic powers easily defeating all the Pokémon. The Iron-Masked Marauder demands Celebi displays more of its power, and the Pokémon responds by picking up a good amount of debris, and Jessie, to create a monstrous ball. Suicune is watching this, and Diana and her grandmother know as well and go to rescue Ash and the others in Mr. White's blimp.
As Celebi moves through the forest, the Iron-Masked Marauder refuses to let Jessie go as he wants her to make a full report to Giovanni about the power he now possesses. He then has Celebi turn the ball into a monstrous creation which fires a purple beam at the Lake, causing an explosion which destroys its purity. Jessie promises the Marauder that she'll guarantee him a promotion when he hands Celebi over to Giovanni, however the Marauder tells her he has no intention of handing Celebi over... instead, he plans to use Celebi to usurp Giovanni and take over Team Rocket himself. The blimp approaches the Marauder and Ash and Sam try to get Celebi's attention, but the Marauder has Celebi fire at the blimp, causing it to crash land in the lake and another shot sends them flying to shore. Ash and Sam are determined to get Celebi back and Ash orders a Thunderbolt from Pikachu against the Celebi-monster, but it has no effect. The Iron-Masked Marauder decides to get rid of Ash and Sam once and for all and order Celebi to fire at them. Ash and Sam have no way of avoiding the beam that's forming, and Celebi fires...
Ash and Sam appear out of the smoke... on Suicune, who had arrived just in time. Suicune confirms it's there to help, and Ash and Sam prepare to get Celebi back. The Iron-Masked Marauder notices Suicune's arrival and decides to capture it too, and sends out his Dark Tyranitar and orders a Hyper Beam. Brock knows Tyranitar has to be stopped and sends out Onix against it. The two Pokémon begin to fight however Onix, despite its size advantage, finds itself to be no match against Tyranitar's strength. Meanwhile Suicune attempts to find an opening to get Ash and Sam to Celebi but cannot get past the Celebi-monster's defenses. Eventually Tyranitar heads towards Suicune who unleashes a powerful BubbleBeam which knocks it back, allowing Onix to use its tail to send Tyranitar flying into the Lake, taking it out of the fight. However the battle has taken its toll on Onix who faints. Brock congratulates Onix on a job well done and returns it to its Poké Ball.
Meanwhile, Suicune is finally able to make a run for Celebi up the monster's arm, but is caught by the creature's tendril which start to sap the energy out of it. Ash and Sam are sent flying, but are caught by Jessie who informs them of Celebi's location. Ash and Sam climb the monster and find Celebi at its heart. Ash and Sam start to climb through, withstanding Celebi's attacks and try to remind it of its previous gentle nature. Eventually, Celebi starts to regain its memories of Ash, Sam and Pikachu and the tendrils holding Suicune release it. Celebi soon breaks free of its brainwashing, destroying the Dark Ball containing it.
Now that Celebi is free from the Iron-Masked Marauder's control, the Celebi-monster is left to crumble into the lake along with the Iron-Masked Marauder and Jessie. Celebi flies Ash and Sam out of the disintegrating creature however it starts to lose strength. By the time Ash's friends and Suicune meet Ash and Sam at the lakeside Celebi is unconscious, something is seriously wrong. Just then Celebi withers in Ash's arms, to everyone's horror. Brock suggests putting Celebi into the water, however it has no effect as the lake's water has been tainted by the attack on it. Suicune however has the power to save the lake, and jumps across the water purifying and restoring it with every step.
Ash places Celebi into the water, however despite being clean it still has no effect. Ash then tries feeding it the Berries it liked earlier, but Celebi doesn't move and the Berries fall into the lake. It is now clear that Celebi is dead, and Ash and the villagers start to weep. Sam angrily states that Celebi didn't do anything wrong, that is was forced to attack the forest and never got the choice... and now it can never have a choice. Sam starts to cry as well, as the others continue to sob, upset at losing such an innocent Pokémon and friend. Suicune and the Forest Pokémon are also devastated, and all cry out in anguish.
Suddenly, a bright light appears in the sky enveloping the lake causing everyone to look up. The light vibrates for a few seconds, before a portal opens through which several Celebi appear. They cause the Celebi lying dead in Ash's arms to rise up and the take it to the middle of a circle and start to give it energy. Towa explains that the spirits of the past and the future can travel through time too, and so they've all come to help their fallen friend. Celebi's body returns to its previous state and the tiny Pokémon suddenly wakes up completely revived to everyone's joy. The Celebi spirits travel back through the portal, which closes in a magnificent display of light. Celebi is now full of life and starts to fly across the lake, happily returning to everyone on the shore.
The reunion is cut short when the Iron-Masked Marauder suddenly emerges from the lake grabbing Celebi. Determined to get away with Celebi one way or another, two rockets emerge from a jet pack on his back and he flies away. Ash is desperate to not let him get away and grabs the Iron-Masked Marauder's leg as he rises and holds on tight, despite rising very high very fast and with the Maurauder trying to kick him off. Ash climbs up his legs orders Pikachu to use Thunderbolt on the evil man, causing the jet pack to explode, and he, Ash, and Pikachu to fall back to Earth. Ash and Pikachu know they will never survive a fall from this height and brace themselves for the inevitable... when Celebi comes to the rescue, helping them fly and returning to their friends. the Iron-Masked Marauder falls through the trees, eventually reaching the ground, losing his helmet, and having to face the wrath of the Arborville citizens and several Bug-type Pokémon. He goes to send out his Scizor & Sneasel, but the Dark Balls are missing, and then all of the Bug types use String Shot to tie him up.
Back at the lake, Ash and company say goodbye to Suicune, and Celebi prepares to travel back in time 40 years to return Sam from where he came. As Ash says goodbye, Sam and he agree that they'll see each other again one day. Celebi and Sam then disappear as they travel through time and those who remained in the present are saddened by Sam and Celebi's departure, with Ash especially upset that his new friend had to leave.
Soon afterwards Ash, Misty, and Brock find themselves back where they started, calling Professor Oak once again to confirm that it indeed was a Suicune they saw, and Misty adds that they also were able to see Celebi. Oak notices Ash's disheartened face and asks him what exactly is bringing him down, as he hasn't said a word since they began talking. Ash replies that it's because he made a really good friend, but now it seems they'll never see each other again. Professor Oak responds that true friendships can withstand the test of time and he's absolutely sure that he'll see Sam again and that even though they're separated, they'll be friends forever. Ash feels better from Oak's kind words and promises to tell him the full story when he returns to Pallet Town, and Oak remarks that he's looking forward to it.
After hanging up, Misty notices something: How could Professor Oak have known that the boy they met was named Sam if none of them mentioned this? Before the gang can think on it too much, the next ferry they're taking is prepared to leave, and they have to go catch it. Brock can only simply chalk it up to being that Professor Oak is a brilliant man who knows everything as they run off to more adventures.
Back in Oak's lab, the Professor is looking through a sketchbook—but not of Tracey's, of his own. Talking to himself, he says that it's all as if it happened yesterday, revealing to the viewers the drawing of Celebi and Pikachu together that he drew and that Sam was actually the younger Professor Oak.
In the end, Jessie swims in the lake, and James and Meowth find her on a raft. Soon after they meet back up, a Tyranitar, formerly the Iron-Masked Marauder's, attacks the raft. As it swims away, the Iron-Masked Marauder's Scizor and Sneasel are also revealed, returning to their wild life on being freed from the Dark Balls. The movie, like the others, ends on a Team Rocket note.