Some decades later Ember's food supplies are becoming depleted and blackouts are increasingly frequent and longer-lasting, as the hydroelectric generator that powers the city has deteriorated. Much of the knowledge and technology from the city's near-mythic Builders and earlier generations has been lost.
Mayor Cole, understanding the gravity of the city's situation, has been stockpiling food in a secret bunker to guarantee his own survival. After discovering the bunker, Lina attempts to report Cole's hoarding but instead is brought to the mayor. He suspects that Lina, a descendant of the earlier mayor who died in office, may be in possession of lost secrets about Ember and orders her and Doon arrested.
Indeed, Lina has the box in her home and has begun to understand its importance. The pair escapes and try to find their way out of the city with the instructions left in the box by the Builders, and receive unexpected assistance from Doon's elderly mentor Sul. Meanwhile, Mayor Cole goes to his bunker and he is killed by a giant star-nosed mole. Arriving at the surface they are initially disappointed that it is dark there as well, as described in Ember's folklore, but when the sun rises they discover that light has returned to the skies and the planet has recovered. They also see through a hole the lights of Ember deep below the surface and realize they had lived in an underground city. Lina and Doon drop a message tied to a rock through the hole down to Ember telling the other citizens how to leave the city, where it is found by Loris Harrow, Doon's father and one of the few adults aware of the city's serious situation.