Plot
One hundred years ago, the power of the Pokémon Hoopa was confined inside the Prison Bottle after it became destructive and out of control. In the present, Ash Ketchum and his friends, Pikachu, Serena, Clemont, and Bonnie are pulled through a portal created by Hoopa's interdimensional rings to Dahara City. Hoopa attempts to use its rings to transport everybody to the nearby Dahara Tower but it is revealed that, in its altered state, Hoopa cannot travel through the rings it creates. Baraz, one of Hoopa's caretakers and the great grandson of the man who sealed off Hoopa's power, arrives with the Prison Bottle. The bottle possesses Baraz and makes him release a shadow of Hoopa created from the anger of being confined for 100 years. Hoopa's power is put back into the bottle.
Team Rocket tries stealing the bottle, and the instant Meowth takes hold of it, he becomes possessed, and opens the bottle to unleash Hoopa's power. Hoopa fights the power and is able to keep it at bay, but Hoopa's shadow then develops as a separate Pokémon, which attempts to take over the real Hoopa. In the struggles, the Prison Bottle explodes. Hoopa summons the Legendary Pokémon Lugia, who distracts Hoopa's shadow as Hoopa makes its escape. Baraz and his sister Meray know that they can make a new bottle at Dahara Tower with the power of earth, fire, and water, deciding to use Serena's Braixen, Ash's Frogadier, and a wild Hippopotas from the desert.
Lugia meanwhile, gains the upper hand in its duel with Hoopa's shadow which ends the conflict by tricking Lugia into flying through a ring which returns Lugia back to its ocean home. Hoopa then summons the Legendary Pokémon Latias, Latios, and Rayquaza. Ash, Hoopa, and Pikachu ride on Latias and Latios, while Rayquaza helps to battle Hoopa's shadow. Ash commands the Pokémon to attack, but Hoopa's shadow summons Groudon, Kyogre, Dialga, Palkia, Giratina and Kyurem. Meanwhile, at the tower, the others are working to make a new Prison Bottle, using the powers of fire, earth, and water.
Rayquaza creates a twister around Dahara Tower to protect it, while the others inside reforge the Prison Bottle. However, Hoopa's shadow and the Legendary Pokémon break through it. The bottle is made again, but Baraz drops it; Ash catches it but gets possessed. Hoopa cleanses the shadow of itself with its happy memories, causing the evil to disappear. However, due to too many legendary Pokémon being summoned, a time warp forms around the tower. Hoopa, its fully restored powers no longer affected by anger, helps everyone inside the tower escape with its rings, but Hoopa cannot pass through the rings. Just then, the space-time rift stops; Arceus stops it with its power, giving Hoopa one more chance to escape. Hoopa escapes, remembering the words of Baraz and Meray's great grandfather that originally confined Hoopa's power, and considers Baraz and Meray family. Hoopa decides to stay with them, and is finally able to travel through the ring. Hoopa decides to rebuild the city before returning to its home in the Arche Valley.