65 million years in the past in the Cretaceous Montana, Rex was a savage and frightening creature who terrorized smaller dinosaurs. As he is seen chasing a Thescelosaurus, his rampage is interrupted when a futuristic aircraft arrives, and he is then greeted by a small green alien-like creature named Vorb who lures him into the craft and force feeds him "Brain Grain", a cereal that increases a creature's intelligence. Rex is given his name and introduced to other dinosaurs that have been fed Brain Grain: Dweeb the green Parasaurolophus , Woog the blue Triceratops and Elsa the purple Pterodactyl, who develops an immediate crush on Rex. Hubie, Marina, Rocko, Petra, Beanie, Timmy, Pikatwo, Bonkers, Fawn and Buck greet them moments later.
Later, they meet Captain Neweyes, the inventor of the cereal and pilot of the aircraft, who then reveals his goal of allowing the children of the present time to see real dinosaurs, fulfilling their biggest wishes. He informs them that there are two people to watch for: Dr. Juliet Bleeb, a scientist from the Museum of Natural History who will aid the dinosaurs, and Professor Screweyes, Neweyes' insane brother. He instructs them to find Bleeb and avoid Screweyes.
Neweyes drops Hubie, Marina, their friends and the dinosaurs off at the East River in 1993, where they meet a young boy named Louie, who plans on running away to join the circus. Upon reaching New York City, they meet Corey, Neesha and Fergus who reveals that their memories were restored by Mewtwo. After meeting the dinosaurs, Corey points out that the citizens would panic if they saw live dinosaurs and, with the help of Elsa, Louie flies over the city along with Rock, Petra, Beanie and Timmy in search of a good hiding place. During the flight, They come across a girl named Cecilia, who was crying; she explains that her parents are hardly around (saying that her father is into business, and her mother is more of a socialite). Louie convinces Cecilia to abandon her home and introduces her to Hubie, Marina, their friends and the dinosaurs. Louie and Cecilia then quickly develop an infatuation for each other, much to Beanie's disgust.
When the dinosaurs explain their goal of getting to the Museum of Natural History, Louie decides to disguise them as floats in the Macy's Thanksgiving Day Parade. During the parade, Rex hears all the children wishing to see real dinosaurs, so he starts to sing "Roll Back the Rock (To the Dawn of Time)" (the movie's theme song). When he sees the Apatosaurus balloon coming out in the parade however, Rex mistakes it for being real and hand shakes it too tight with his claws, causing its air sealer to pop open. The balloon runs out of air and falls on the dinosaurs, who are otherwise unharmed. When the audience realizes that live dinosaurs are among them, they fly into a panic. The local authorities are called in to stop the dinosaurs, resulting in a slapstick-filled chase scene. Hubie, Marina and their friends attempt to rescue them while the Pokemon trainers use their Pokemon to help out.
As they finally lose the police, Louie and Cecilia venture to Central Park, where Professor Screweyes is running his "Eccentric Circus". They meet Professor Screweyes and cite their desire to join his circus. As they sign a contract, Hubie, Marina, their friends and the dinosaurs arrive and try to save them. Screweyes, upon meeting the dinosaurs, explains that he delights in scaring people and believes that the dinosaurs would make a great addition to his circus. He then reveals his very own "Brain Drain", pills that are the polar opposite of his brother's Brain Grain. He hypnotises the the two children, and demonstrates the Brain Drain, devolving them into chimpanzees; however, he makes the dinosaurs a deal: if the dinosaurs consume the pills and join his circus, he'd destroy the contract and release Louie and Cecilia; reluctantly and sadly, the dinosaurs accept the offer.
Believing that his friendship with Louie, Cecilia, Hubie and his friends will be lost, Rex, reverts the children back to their human selves (and thus wearing off the effects of the Brain Drain), tells them to remember him.
As Hubie, Marina, their friends and the kids awake the next morning, they are greeted by a circus clown named Stubbs. Upon seeing the dinosaurs returned to their natural vicious states, Louie and Cecilia, with the help of Stubbs, Hubie, Marina and their friends, plan to sneak into the night's show and save the dinosaurs. Professor Screweyes claims he can control the now-wild Rex, which he succeeds in doing by hypnotizing him. Everyone watching the show gets frightened during the performance, and many run away. After a crow turns on a highlight, causing the hypnotic effect to end. Rex realizes he has been tricked, becomes enraged and tries to attack Screweyes. However, Louie and Hubie step in and desperately tell the devolved Rex that killing Screweyes would be worse than what was happening right this moment. These impassioned pleas serve to return the dinosaurs to their friendly natures. Just then, Captain Neweyes arrives in his aircraft and congratulates Hubie, Louie and Cecilia, who proceed to kiss in front of a whole crowd of people; simultaneously, Elsa tells Rex her true feelings towards him, possibly sparking a relationship between the two. After Stubbs arrives to resign from Professor Screweyes's employ (which includes him giving him back most of his belongings, with comedic results), Captain Neweyes, Louie, Cecilia and the dinosaurs board the aircraft, leaving Screweyes to be devoured by the crows (who have been present throughout the movie).
The dinosaurs spend the rest of their days in the Museum of Natural History, allowing children to see live dinosaurs, fulfilling their wishes. Meanwhile, Louie and Cecilia reconcile with their respective parents, and the two become a couple. Hubie, Marina and their friends say goodbye to Corey, Neesha and Fergus as they set off for more adventures.
Rex returns Buster to his family before returning to the Museum of National History, humming the movie's theme song to himself.