Haroun is a young boy who lives with his parents, Soraya and Rashid Khalifa, in a city so sad it's forgotten its name, in the country of Alfibay. Rashid is a storyteller, and Soraya loves to sing. Things take a turn for the worse when Soraya stops singing. The Khalifas' upstairs neighbors are Oneeta Sengupta and Mr. Sengupta, who is a weaselly clerk and always says disparaging things about stories and Rashid to Soraya. One day he asks Soraya, "what's the point of stories that aren't even true?", and Haroun, listening from outside, can't get the question out of his head. On the first day of the rains, Haroun comes home from school to find that Soraya ran off with Mr. Sengupta at exactly 11:00. When Rashid noticed that the clocks had stopped moving, he smashed all the clocks in the house. It soon becomes clear that as a result of this Haroun develops a problem, as he can't concentrate on something for more than 11 minutes.
Several days later, Rashid is invited by a politico (politician) to travel to the Town of G and the Valley of K to tell stories to help the politico win election. Rashid accepts and takes Haroun with him. When Rashid takes the stage in the Town of G, he opens his mouth and all that comes out is, "ark ark ark." After threatening Rashid, the politico's henchmen drop Rashid and Haroun at the bus station to find their own way to the Valley of K. While Rashid is attempting to buy their tickets, Haroun meets Mr. Butt, a mail coach driver who agrees to drive them to the Valley of K, and to make a stop at the top of the mountains so that Rashid might enjoy the magnificent view of the sunset over the Dull Lake. The drive is terrifying, as Mr. Butt drives very quickly. However, he gets Rashid to the view in plenty of time.
The politico himself, Mr. Buttoo, greets Haroun and Rashid in K. Haroun immediately doesn’t like Mr. Buttoo and refers to him as “Snooty Buttoo." Surrounded by guards, Mr. Buttoo leads them to the edge of the Dull Lake and into a boat shaped like a swan, as Rashid and Haroun will be staying in a houseboat. As they begin across the lake, Rashid is sad and Mr. Buttoo starts an argument, creating both smelly mist and hot wind. Haroun realizes they're in the Moody Land. As Mr. Buttoo and Rashid argue, the weather gets worse and the boat begins to rock dangerously. Haroun yells for everyone to be quiet and implores his father to think happy thoughts, and the weather calms.
When they reach the houseboat, Rashid bids Mr. Buttoo goodnight and he and Haroun head to bed, Rashid on a bed shaped like a peacock and Haroun on one shaped like a turtle. Haroun and Rashid both can't sleep and decide to switch bedrooms. Moments after Haroun dozes off, he wakes to see a small man with a monkey wrench in the bathroom, muttering about a Story Tap. Haroun sneaks out of bed and startles the man, who disappears and drops his wrench. Haroun grabs it and the man reappears. After some arguing, the man introduces himself as Iff the Water Genie and tells Haroun that he's there to disconnect Rashid's Story Water supply. He tells Haroun to contact the Walrus to resolve the issue, and when Haroun realizes that this is an impossible task, he asks Iff to take him to see the Walrus. Iff agrees in exchange for getting back his wrench, which is actually a Disconnecting Tool.
Iff instructs Haroun to choose a tiny bird from his hand, and Haroun selects the Hoopoe. Iff throws the tiny bird out the window and the Hoopoe grows to be the size of a bed. Iff and Haroun jump on and begin the journey to the moon Kahani. On the way, Haroun is informed that the Hoopoe is actually a machine and is called Butt. Haroun also learns that Kahani doesn't rotate and is undetectable by instruments on Earth. When they land in Kahani's Ocean, Iff offers Haroun some wishwater to fix his problem, but Haroun is unable to successfully make his wish since he can't concentrate for more than 11 minutes. Butt instructs Iff to give Haroun a happy story to cheer him up, and Haroun drinks the proffered story and finds himself in a Princess Rescue Story that has gone horribly wrong. When Haroun wakes, he tells Iff and Butt what happened. Iff and Butt are very worried and say that if the Ocean’s pollution is this bad where they are, then Gup City must be close to war with the Land of Chup—which is on the dark side of Kahani—and particularly with Khattam-Shud, the Cultmaster of Bezaban.
As they travel towards Gup City, Iff explains that Chattergy's Wall in the Twilight Strip separates Chup, the land of perpetual darkness, and Gup, which experiences eternal sunshine. As they draw close to Gup City, Haroun meets Mali, who is a Floating Gardener, and Goopy and Bagha, a pair of Plentimaw fishes. When they reach Gup City, they listen to King Chattergy, General Kitab, Prince Bolo, the Walrus, and the Speaker say that Khattam-Shud has captured Princess Batcheat, is also responsible for poisoning the Ocean, and that war on Chup has been declared. A commotion breaks out on the balcony, and General Kitab announces that they've captured a spy, who turns out to be none other than Rashid Khalifa.
A Page named Blabbermouth is sent to escort Haroun to the royal quarters to meet his father. When he arrives, Rashid is telling his story to the court. He says that he accidentally ended up in the Twilight Strip, where he witnessed the Chupwalas' capture of Princess Batcheat. The court decides that they must go to war and send Blabbermouth to show Haroun to bed first. As they wander through the passageways, Haroun takes a swing at Blabbermouth's head and knocks off his cap, revealing that Blabbermouth is actually a girl. She shows off her juggling and when she wakes Haroun hours later, she threatens him to not tell anyone she's female. Blabbermouth and Haroun head for the garden, where the Guppee Army has just finished arranging itself. Haroun finds Rashid and Iff and the three board Butt the Hoopoe. As the army moves off towards Chup, Haroun hears arguments and debate all around him discussing the merits of General Kitab's battle plan, and whether they should save Batcheat or the Ocean first. Haroun is shocked at this talk, but Butt explains to him the importance of free speech.
The army reaches the dim shore of Chup and sets up camp. Rashid is called to show General Kitab and Prince Bolo the Chupwala camp. He leads them to a clearing and points at a man with a painted face fighting his own shadow. After the man notices his audience he tries to speak, but can't make coherent sounds. Rashid realizes he speaks Abhinaya, the gesture language, and that his name is Mudra. Mudra explains the situation in Chup, most importantly that Khattam-Shud has learned to separate himself from his shadow and can be in two places at once. Mudra then offers to help the Guppees defeat Khattam-Shud. Since Batcheat is being held in the Citadel of Chup, Bolo and the Guppee Army decide to go there and rescue her, while Haroun offers to head to where the second Khattam-Shud is poisoning the Ocean in the Old Zone. Haroun chooses Iff, Butt, Mali, Goopy, and Bagha to go with him.
As Haroun and his companions travel, the water becomes cold and dark, and Goopy and Bagha can go no further. Iff, Butt, Haroun, and Mali soon reach an overgrown forest. Mali disappears ahead to clear a path. Butt, Iff, and Haroun follow, but a group of Chupwalas throw a Web of Night over them and draw them towards a massive ship. The Chupwalas, which look like clerks, tie Butt to a gangway, remove his brain box, and then herd Iff and Haroun up the gangway. Iff trips and presses a “Bite-a-Lite” into Haroun's hand as Haroun realizes that the Chupwalas can manufacture darkness.
When they reach the deck, Khattam-Shud comes out to greet them. He speaks to them in a dull, monotonous voice, and proceeds to switch off the darkness and lead them below deck and explain to them how he's poisoning the ocean and planning to plug the Wellspring. He tells Haroun that worlds are for controlling, and since stories cannot be controlled, he must kill them. As Khattam-Shud points out the generator, Mali quietly enters the ship and destroys it, cutting the ship's power supply. Haroun bites the Bite-a-Lite, puts on a special diving suit, grabs Butt's brain-box, and dives out the window.
After sinking deep enough to see the beauty of the Wellspring, Haroun realizes how to win. He surfaces next to Butt and reconnects Butt's brain box. Haroun swallows the wishwater he still had in his pocket and wishes for Kahani to rotate. After 11 minutes, his wish comes true. The sun melts the ship and the Chupwalas, which are all shadows. Iff and Mali make it safely off the ship.
Meanwhile in Chup City, a Chupwala messenger sent to the Guppee commanders offers them a juggling show, but adds a bomb to the many objects. Blabbermouth seizes the bomb and throws it far away, but is revealed to be female in the process. This angers Bolo, and after he and Blabbermouth fight, Mudra offers to employ Blabbermouth.
The battle between the Guppees and the Chupwalas is an easy one, as the Guppees are united by their trust in each other and the Chupwalas end up fighting their shadows. The army enters Chup City victorious to look for Batcheat when the ground begins to shake and the moon rotates. The Citadel of Chup begins to melt in the sun, and Bolo and a group of Pages frantically rescues Batcheat before she's harmed. The giant ice sculpture of Bezaban falls and crushes Khattam-Shud.
Batcheat and Bolo are married that day, but an Egghead finds Haroun at the festivities and instructs him to report to the Walrus. Haroun attempts to get Iff and Mali to vouch for him, but they refuse. When Haroun enters the Walrus's office, he sees all his friends and Rashid there. The Walrus offers Haroun a happy ending in thanks, and Haroun asks that it be a happy ending for himself as well as his sad city.
Haroun and Rashid fly back to Alfibay on Butt and wake the next morning to find an impatient Mr. Buttoo. When Rashid takes the stage to tell his story for Mr. Buttoo, he tells of their adventure on Kahani. The audience boos Mr. Buttoo away and he's never seen again.
When Haroun and Rashid return to the sad city, they find it's still raining but not so sad anymore. A policeman tells them that they've remembered the city's name, Kahani, which means "story." When they reach their house, Soraya has returned and Rashid welcomes her home. The next day is Haroun's birthday, and he wakes to find a new clock. The clock is working, and he declares that time is moving again.