The English village of Wall lies near a stone wall that is a border with the kingdom of Stormhold in another, magical world. A guard is constantly posted at a hole in the wall to prevent anyone from crossing. In the capital of Stormhold, the king is on his deathbed. He throws a ruby into the sky, decreeing that the first of his fratricidal sons to recover it will be the new king. The gem collides with a star, and they fall together and land elsewhere in Stormhold. The king's remaining two sons, Primus and Septimus, independently search for the gem.
In Wall, Tristan Thorne sees the star fall behind the wall, and vows to retrieve it for the object of his infatuation, Victoria, in return for her hand in marriage. His father reveals to him that his mother is from the other side of the wall, and gives him a Babylon candle that she had left for him, which instantly transports the user to any desired location. Tristan lights it and is transported to the fallen star, a beautiful woman named Yvaine. He promptly chains her in order to take her home to Victoria.
Three witches in Stormhold learn of the fallen star and resolve to find her, intending to eat her heart in order to recover their youth and replenish their magical power. One of the witches, Lamia, sets a trap for Yvaine, magically conjuring an inn in the countryside.
Yvaine is weary and unaccustomed to daytime travel, so Tristan chains her to a tree and promises to return with food. In his absence, a unicorn frees Yvaine, then unwittingly takes her to Lamia's inn. Tristan discovers Yvaine gone and lies down to rest. The stars whisper to Tristan, warning of Yvaine's danger and begging him to save her, instructing him to get on a passing stagecoach which happens to be Primus's.
Tristan and Primus arrive at the inn, interrupting Lamia's attempt to kill Yvaine. Lamia kills Primus, but Tristan and Yvaine escape using the Babylon candle. Because they're each thinking of their respective homes, the candle takes Tristan and Yvaine into the storm clouds, between the earth and the stars, where they are captured by pirates in a flying ship. They befriend the kind-hearted Captain Shakespeare, who teaches Tristan how to fence and fight, and gives him a haircut which lengthens his hair.
Septimus arrives at the site of the inn and discovers that he is the last surviving son of the king, only needing to find the stone to accept the throne. He learns that it is in the possession of the fallen star and that the heart of a star grants immortality .
After leaving Captain Shakespeare's ship, Tristan and Yvaine make their way to a village near the wall, where they spend the night at an inn. Come morning, Tristan leaves Yvaine sleeping and goes to Wall, bringing with him a lock of her hair, to tell Victoria that he won't marry her, having fallen in love with Yvaine. When the lock turns to stardust, he realizes that Yvaine will die if she crosses the wall, and he rushes back to save her.
Yvaine wakes up to find Tristan gone, and she starts walking toward the wall, believing that he abandoned her to go back to Victoria. Tristan's mother, Una, notices Yvaine walking to her doom, so she takes her caravan to the wall to stop her. Lamia arrives and captures both Yvaine and Una, taking them to the witches' castle.
Septimus and Tristan both pursue Lamia and meet at the castle, agreeing to work together for the time being. Barging into the witches' castle, Septimus recognizes Una as his sister, daughter of the king. Una and Tristan meet for the first time, and she informs him that she is his mother.
Septimus and Tristan fight the witches, but Lamia kills Septimus using a voodoo doll , then uses it to make his corpse fight Tristan. Just as Lamia is about to kill Tristan, Yvaine, more in love with Tristan than ever, unleashes a wave of starlight that disintegrates Lamia.
Tristan retrieves the jewel that Yvaine was wearing. Una explains that Tristan is the last male heir of Stormhold. Tristan becomes the new king with Yvaine as his queen. Later, after eighty years of ruling Stormhold, they both use a Babylon candle to ascend to the sky, where Tristan also becomes a star. Since Yvaine "gave her heart" to Tristan, the two will live forever in the sky .