Buck emerges from the underground with an ancient stone obelisk foretelling that past extinctions occurred on regular cosmic cycles, and that the next asteroid will impact at the exact crash site of all previous ones. The herd sets out for this epicenter, pursued by Gavin the Dromaeosaur and his children, who foolishly believe birds will inherit the Earth once the land mammals are wiped out.
Upon reaching the crater, the herd discovers Geotopia, a magical community thriving inside the interior of a previous giant geode meteor. The magnetic space crystals inside emit radiation that keeps all inhabitants perpetually young. Sid falls in love with Brooke, a sloth resident. When Buck proposes launching the magnetic crystals into an active volcano to magnetically pull the incoming asteroid off-course, Shangri Llama adamantly refuses. Sid accidentally dislodges the central crystal powering the geode wall, causing Geotopia to collapse into regular stone and the residents to rapidly age into their natural physical years.
With Geotopia destroyed, the residents unite behind Buck and Julian's plan. Gavin and his raptor children initially try to sabotage the effort, but Buck and Roger convince Gavin that an extinction-level impact will kill flying creatures as well. Together, all species roll a gigantic magnetic crystal boulder to the volcano's caldera. When the boulder gets stuck, Julian uses his ingenuity and knowledge of leverage to dislodge it just in time. The volcano erupts, firing the magnetic mass into the atmosphere, successfully deflecting the asteroid harmlessly back into deep space.
Peaches and Julian celebrate a lavish wedding surrounded by their united herd, with Manny giving his complete blessing. Brooke and the Geotopians find that a crystal fragment fell into their hot spring, granting them renewed youthful vitality. Meanwhile, Scrat's spaceship continues hurtling through deep space, where he inadvertently causes Mars to lose its atmosphere and oceans, rendering it a barren desert.