NASA Space Shuttle Explorer, commanded by veteran astronaut Matt Kowalski, is in Earth orbit on mission STS-157 to service the Hubble Space Telescope. Dr. Ryan Stone is aboard on her first space mission as a mission specialist, her job being to perform a set of hardware upgrades on the Hubble. During a spacewalk, Mission Control in Houston warns Explorer’s crew about a Russian missile strike on a defunct satellite, which has inadvertently caused a chain reaction forming a rapidly-expanding cloud of space debris, ordering the crew to return to Earth immediately. Communication with Mission Control is lost shortly thereafter as more and more communication satellites are knocked out by the debris.
High-speed debris strikes the Explorer and Hubble, tearing Stone from the shuttle and leaving her tumbling through space. Kowalski, using a Manned Maneuvering Unit (MMU), rescues Stone, and they return to the Explorer, soon discovering that the Shuttle has suffered catastrophic damage and the rest of the crew are dead. Stone and Kowalski decide to use the MMU to reach the International Space Station, which is in orbit about 1,450 km (900 mi) away, Kowalski estimating that they have 90 minutes before the debris field completes an orbit and threatens them again.
On their way to the International Space Station (ISS), the two discuss Stone’s home life and her daughter, who died young in an accident. As they approach the station, they see that the ISS’s crew has evacuated using one of its two Soyuz spacecraft, the remaining Soyuz’s parachute having been accidentally deployed in space rendering it unable to return to Earth. Kowalski suggests using it to travel to the nearby Chinese space station Tiangong, 100 km (60 mi) away, in order to board the Chinese Shenzhou to return safely to Earth. Out of air and maneuvering fuel, the two try to grab onto the ISS; the duo’s tether snaps on one of the station’s solar panels. Stone’s leg gets entangled in the Soyuz’s parachute cords and she grabs a strap on Kowalski’s suit, but it soon becomes clear that the cords will not support them both. Despite Stone’s protests, Kowalski detaches himself from the tether to save her from drifting away with him. Stone is pulled back towards the ISS, while Kowalski floats away.
Stone enters the space station via the airlock of the Pirs Docking Compartment. She cannot re-establish communication with Kowalski nor Earth and concludes that she is now the sole survivor. Inside the station, a fire breaks out, forcing her to rush to the Soyuz. As she maneuvers the Soyuz away from the ISS, the tangled parachute tethers snag, preventing the spacecraft from leaving; Stone performs a spacewalk to cut the cables, succeeding just as the debris field returns, destroying the station. Stone angles the Soyuz towards Tiangong, but soon discovers that the Soyuz’s engine has no fuel.
After a poignant attempt at radio communication with an Eskimo on Earth, Stone resigns herself to her fate and shuts down the cabin’s oxygen supply to commit suicide. As she begins to lose consciousness, Kowalski enters the capsule; scolding her for giving up, he tells her to rig the Soyuz’s soft landing rockets to propel the capsule toward Tiangong before disappearing. Realizing Kowalski’s appearance was a hallucination, Stone regains the will to go on, restoring the spacecraft’s oxygen flow and rigging the landing rockets to propel the capsule towards Tiangong.
Unable to dock with Tiangong, Stone ejects herself from the Soyuz and uses a fire extinguisher as a makeshift thruster to travel to the rapidly deorbiting Tiangong. Stone manages to enter Tiangong’s Shenzhou capsule just as the station enters the upper atmosphere, undocking the capsule just in time. She radios Houston her status but does not receive a response.
The Shenzhou capsule re-enters the atmosphere successfully and, despite sustaining debris damage during its descent, lands in a lake. Radio communication from Houston informs Stone that she has been tracked on radar and that rescue crews are on their way. Stone takes off her helmet and opens the hatch but is unable to exit due to water rushing in. She takes a deep breath and holds it until the capsule sinks, allowing her to swim through the hatch. Underwater, her suit weighs her down, so she takes it off, surfaces, and swims ashore, where she crawls onto the beach, laughs, and stands to look around.