Ash arrives at the Canalave Gym, only to hear bad news: the Gym Leader is away on Iron Island, and the locals are all sleep-deprived due to horrible nightmares! Officer Jenny blames the Darkrai that visits Canalave City once a year; a Cresselia from Full Moon Island always drives Darkrai away, but Darkrai is early this year and Cresselia is nowhere to be found. Officer Jenny bought a Lunar Wing charm to ward off bad dreams, but it's not working. When Brock inspects it, he realizes it's just a fake made from a lacquered Pidgey feather! An investigation leads Ash and the gang to Team Rocket, who are using a nightmare-generating machine to create a market for their fake Lunar Wing charms.
Pikachu and Ash knock out Team Rocket in no time, and everyone looks forward to a good night's sleep. But that night, the nightmares return! Concerned that Darkrai may be in town after all, Jenny takes our heroes to Full Moon Island in search of Cresselia. Dawn's Swinub tracks Cresselia's scent to a cliff known as Cresselia's shrine. Sure enough, Cresselia appears, but Team Rocket's Magikarp sub pops out of hiding and snags everyone in a net. Swinub tries to fight Team Rocket to save everyone, but it's no good until it evolves into a mighty Piloswine and smashes the sub with a single hit!
As soon as Cresselia is freed, Officer Jenny asks it to help protect the people of Canalave. Cresselia flies to the city and calls Darkrai out of hiding. Darkrai is lurking near the ruins of Team Rocket's nightmare machine, almost as if it was the machine's signal that lured Darkrai to town. Cresselia challenges Darkrai, and Darkrai wisely decides to retreat. Its work done, Cresselia disappears as well. At last, everyone can enjoy a peaceful night of sleep. Ash will surely need that rest so he can start training for his Canalave Gym challenge!
Ash and his friends go to Canalave Gym, only to hear the Gym referee screaming. He steps outside completely exhausted, telling the group that everyone has been having nightmares. As Ash asks for a Gym battle, the referee informs him that the Gym Leader is out training on Iron Island and won’t be back for a couple of days. Dawn decides that some shopping will cheer up the disappointed Ash, however, they find the most popular shopping area on the island is deserted. Brock sees a police station, and goes to make a move on a very tired Officer Jenny.
At the police station, Jenny cannot stay awake. She informs them that all the people in the town are having nightmares, and that the cause of the nightmares seems to be the Pokémon Darkrai. Jenny admits the nightmares an annual occurrence, however Cresselia always helps Canalave City overcome its sleeplessness. She pulls out a Lunar Wing, telling them that even though she paid good money for it, it doesn't seem to be working. Brock examines it with a magnifying glass and finds out it's just a lacquered Pidgey feather. Jenny runs out in a rage, determined to arrest the counterfeiters – none other than Team Rocket. Over at the Lunar Wing stall, Meowth and Jessie retreat inside their tent as they prepare more fake Lunar Wings and their Nightmare Machine, which they have built to scam people into buying their Lunar Wings. However Jenny hears them admit the forgeries and moves in to arrest them. Team Rocket remove their disguises and recite their motto. Pikachu uses Thunderbolt and sends them blasting off, destroying the machine.
Officer Jenny is immensely grateful, so she prepares dinner for the group and has them stay over at the police station. Later that night, the group awaken to the same nightmare, and find out that the real Darkrai is nearby, and that they must summon Cresselia to stop it. The group and Jenny set off for Fullmoon Island, with Team Rocket following closely in their Magikarp submarine. They plan to catch Cresselia and Pikachu as an added bonus.
On the island, the group discovers a real Lunar Wing, and Piplup picks up a scent. However, this is only the scent of a Psyduck, so Dawn brings out her Swinub. Swinub tracks down the shrine which Cresselia is supposed to appear at, and sure enough, Cresselia appears in a flash of light. Meanwhile, Team Rocket launches a missile from their sub and trap Cresselia in a net. They extend legs on the sub, then move up to the cliff where the shrine is and trap everyone but Swinub, who uses Take Down, but gets knocked back every time. Pikachu attempts to use Thunderbolt, but only succeeds in shocking Ash. Swinub continues to get knocked back, but evolves into Piloswine out of sheer determination. Using Take Down, Piloswine destroys the sub, sending Team Rocket blasting off.
The group frees Cresselia, who flies over to Canalave to battle Darkrai, who was originally drawn to the electromagnetic pulses from the Rocket trio's Nightmare Machine. Cresselia’s bright light leads Darkrai to retreat, before returning to the night sky in a flash of light. With Darkrai gone, everyone can get a good night's sleep before Ash starts training for his upcoming Gym battle.