In the early 1900s, a young orphan named Pete flees his abusive adoptive hillbilly family, the Gogans. As Lena Gogan and company pursue him (“The Happiest Home in These Hills”), an unseen force, which Pete calls Elliott, knocks them into a mud pit. The next morning, Pete and Elliott, a green and purple dragon who has the power of invisibility, share breakfast (“I Love You, Too”) and visit Passamaquoddy, a village where the unseen Elliott, performing clumsy antics, causes Pete to be labeled a source of ill luck. Lampie, the drunken old lighthouse keeper, stumbles out of a tavern and encounters Pete. Elliott makes himself visible, and a terrified Lampie runs into the saloon to warn the townsfolk (“I Saw a Dragon”). In a seaside cave, Pete scolds Elliott for causing trouble. Just as they make up, Lampie’s daughter Nora appears. She says that due to the ongoing tides from the sea, it’s unsafe for Pete to stay. She offers him food and shelter at the lighthouse, which Pete accepts. Pete tells Nora of the abuse he suffers at the hands of the Gogans and, as Nora offers to let him stay the night at the lighthouse, they strike up a friendship (“It’s Not Easy”). Pete learns the story of Nora’s fiancé, Paul, whose ship was reported lost at sea the previous year. Pete promises to ask Elliott about Paul, and Nora accepts, believing Elliott to be an imaginary friend.
The next morning, Dr. Terminus, a medicine showman, and his shill, Hoagy, arrive and win over the gullible townspeople, who are initially angered by their return (“Passamashloddy”). That evening, Nora sings (“Candle on the Water”) to her lost lover. The local fishermen complain about the scarcity of fish and believe Pete is the cause. Nora reminds them the fishing grounds shift and that Pete should be welcomed in town (“There’s Room for Everyone”). Nora takes him to school, where he is punished unfairly by Miss Taylor, the strict teacher, as a result of Elliott’s antics. An enraged Elliott smashes into the schoolhouse.
Dr. Terminus, convinced of Elliot’s existence and knowing that dragon anatomy has medicinal uses (“Every Little Piece'”), makes Pete an offer for Elliott, which he refuses. Believing he needs to stop running from the Gogans, Nora and Lampie offer to let Pete live with them permanently, which Pete accepts (“Brazzle Dazzle Day”). However, the Gogans arrive in town and confront them, demanding that Nora and Lampie surrender Pete and threatening legal action if they refuse (“Bill of Sale”). Nora refuses to hand Pete over and, as the Gogans attempt to chase them in a small boat, Elliot “torpedoes” their boat, saving Pete. Dr. Terminus offers to help the Gogans capture Pete if they use him as bait so Terminus can capture Elliot, which they humorously agree to, despite not believing Elliot to be real. Terminus also convinces the superstitious locals that helping him capture the dragon will solve their problems. That evening, a storm begins to blow.
At sea, a sailing ship is approaching Passamaquoddy, its captain assisted by Paul. Dr. Terminus lures Pete to the boathouse, while Hoagy does the same to Elliott. Once there, the invisible Elliott discovers Pete but is caught in a net. He frees himself and saves Pete, then confronts the Gogans, who flee in their wagon. Lena Gogan yells at Elliott, showing him her Bill of Sale, which he lights on fire before dumping her into a vat of tar, after which he scares the Gogans’ horse, which takes off, leaving the Gogans to chase it.
Terminus attempts to shoot Elliott with a harpoon but fails to notice that the rope attached to the spear is snagged around his ankle. Hoagy tries to warn the Doc, who panics and points the harpoon skyward, which fires the harpoon through the ceiling of the warehouse, taking the Doc with it. Hoagy attempts to free Terminus, but Elliott destroys the wind wagon, cutting off their escape. Elliott then saves the Mayor, Miss Taylor, the sheriff, and other town council from a falling utility pole, revealing himself to the grateful townsfolk. Back at the lighthouse, the lamp has been extinguished by a storm-driven rogue wave. Elliott returns and tries to light it with his own fire. As he does, Nora sees that he is real. The light is ignited, and the ship is saved.
The next morning, the townsfolk praise Elliott for his help, and Nora reunites with Paul, who was the sole survivor of a shipwreck at Cape Hatteras and suffered amnesia. Now that Pete has a loving family, Elliott tells him that he must move on to help another kid in trouble, and the two part.