In space, an astronaut is outside a satellite doing some repair work. When he’s about to finish, he and the satellite suddenly get hit by very fast projectiles. The astronaut is pushed away and the satellite receives heavy damage until it blows up.
Soon the shuttle is hit and explodes too, killing all the astronauts inside. In NASA, everyone panics over this unexpected tragedy and they begin going over the footage to understand what happened. Their scan discovers a bunch of tracks heading toward the Atlantic seaboard and they rush to inform the president while making a plan.
At the same time in an observatory, a man is using his telescope and notices an explosion in space. In the morning, people in New York are learning about the shuttle explosion on the news when suddenly the screens start failing and balls of fire begin falling from the sky. People panic and run as cars and buildings get destroyed one after the other, but soon hundreds of casualties are added to the pile.
The buildings also fall, causing even more destruction. Eventually New York is nothing but havoc on fire. NASA confirms it’s a meteor shower but they still have no explanation for it.
The observatory man gets in contact with them and shares what he saw, so NASA immediately moves the Hubble to take a look. It turns out the meteorites from earlier were pushed out from the belt by a massive asteroid that’ll hit Earth on eighteen days. If they don’t stop it, it’ll end all life on the planet.
Meanwhile a Greenpeace ship is protesting against an offshore oil drilling platform. The owner Harry is playing golf and hits the activists with the ball just for fun. At that moment Harry hears from Chick that one of the drills is malfunctioning and Harry yells as he bursts into AJ’s quarters to scold him for it.
AJ apologizes faster than usual and Harry gets suspicious. Noticing some women’s clothes, he checks the bed and finds his daughter Grace. Panicking, AJ escapes through the back door and runs all over the place while Harry keeps shooting at him, breaking various things in the process.
When a bullet hits a lamp, the ricochet wounds AJ’s leg. The chase is interrupted when clients arrive, but Grace still tells Harry if he tries to control her life, she’ll quit. At NASA, scientists are meeting with the military to discuss ideas, but none of them are useful.
Eventually a doctor proposes a good plan: since simply firing rockets at the asteroid won’t work, they must drill into it and place a nuclear warhead inside to blow it up. To do so they’ll need the best drillers on the planet. Back in the oil platform, Harry’s team is dealing with a gas pocket that causes oil to splatter on their faces.
Grace immediately takes the clients out of the way and the workers rush to descend from their tower as the oil starts bursting out. Thankfully Harry manages to make everyone take cover right before the oil catches on fire. Working together, they manage to put the flames out.
This accident was caused by AJ’s carelessness so Harry fires him. At that moment the army arrives to recruit Harry, but he only agrees to go if they bring Grace as well. Later at NASA, the duo is shown the confidential file about the asteroid and told about the end of the world.
They’re also shown a drill that was originally designed for the Mars project. NASA wants Harry to teach their astronauts how to use it since he's the best driller. Recognizing the drill as his own design, Harry tells them they built it badly and that he can’t just train astronauts in a few days to do it right, so instead he volunteers to go with his team to do the job themselves.
Afterward Harry chooses the members of his team and the FBI goes to pick them up. They find Bear riding his bike, Max getting a tattoo, Hound picking up women at a bar, Oscar riding a horse at his ranch, and Chick at the casino. Harry has no choice but to recruit AJ too since there’s a tool only he knows how to use.
The team is upset to hear what the mission will be like but agree to do it since the alternative is death. However in exchange they ask for a few favors, like paid vacations or getting rid of parking tickets. Next the team is put through a series of physical and psychological tests to check on their health and they drive the doctors crazy with their shenanigans.
None of them are healthy enough to go to space, but NASA doesn’t have any alternatives so they’ll send them anyway. Then they get to see the shuttles that will take them to space called Freedom and Independence. They also meet the astronauts that will go with them, led by Colonel Willie.
For the next few days, the team is put through various forms of training like exercising, moving underwater to simulate weightlessness, and flying in high-speed fighters. They move at record speed, which leaves them very dizzy and puking. In a special chamber, they put on the special suits with thrusters to practice how to move in low gravity.
There’s also lots of work done on the drill itself to make it work right. Eventually everyone has a meeting to agree on the steps of the plan. The shuttles will first stop at the Russian space station for fuel, then they’ll fly to the Moon.
Lunar gravity plus burning the thrusters will slingshot the shuttles around the Moon and position them behind the asteroid to do the drilling. The scientists hope that the tail debris will be cleared by the lunar gravity too, and the shuttles will land at two separate soft spots for an extra chance. The team must detonate the nuke before the asteroid reaches the zero barrier or it’ll be too late.
One night Harry sees AJ and Grace being affectionate and this time he doesn’t protest. AJ asks Grace to marry him and gives her a ring. The rest of the team reminds Harry that Grace is an adult, so he should let her make her own choices.
Sometime later, they do an underwater simulation. The team begins the fake drilling and the scientists send them a gas pocket to test their problem-solving skills. Harry and Bear warn AJ that he’s making some risky choices, but he ignores them and keeps going, causing the drilling to fail.
If this had been on the asteroid, they would be dead. While the scientists reset the simulation, Harry yells at AJ and reminds him what’s at stake. The day before launch, Harry convinces NASA to let the team spend time with their families.
AJ and Grace go on a picnic and share a romantic moment together. Meanwhile Chick visits his ex and his son, who never knew his father. Chick has a court order that forbids him from getting close, so he just apologizes for being a bad family man and leaves a toy shuttle for the boy.
Hound uses the free time to take out a loan and goes to a naughty club with Max. All the workers concentrate on them because of the money and a gang gets jealous, so they start a fight. They barely get to exchange a few hits and break a bottle before the police arrests them.
Meanwhile in the South Pacific, a meteorite lands in a river and destroys the town surrounding it, causing multiple explosions that bring down the buildings and kill thousands of people. Soon the whole world knows about the incoming asteroid and the area around the NASA building fills with reporters. On the day of the launch, Harry and Grace share a heartfelt goodbye.
Grace tells him she’s engaged and Harry promises he’ll come back. The president speaks on national TV and wishes everyone good luck on the mission. The team suits up and AJ sings to Grace to say goodbye, causing the others to join in a lovely chorus.
As they board the shuttles, the cameras films the teams and Chick’s ex finally tells her son that’s his dad. The countdown begins and soon both shuttles launch successfully. Once they stabilize, the team takes off their helmets and admire the vastness of space.
At the Russian station, astronaut Lev gets in contact with them to coordinate their arrival. The NASA astronauts are expert pilots and perfectly dock the shuttles on the station, so the teams rush to transfer the fuel. While the others connect the fuel lines, Lev takes AJ into the fuel pod and teaches him how to use the control panel.
The transfer begins, but the team is unaware of a hidden leak. AJ notices some strange numbers on the panel and tries to warn the others, but they don’t hear him. When he tries to shut it down, the lever breaks.
The alarm then goes off and Lev finally notices the leak, so he sends everyone back to their shuttles while he and Willie go back for AJ. The panel begins sparking and coming apart as the leak triggers a fire in the fuel pod. AJ starts going up the stairs when suddenly the flames burst up, but thankfully AJ moves out of the way just in time.
Soon the entire station is shaking, sparking, and steaming. NASA orders the team not to bother to put out the fire and just leave. The astronauts come back to take Willie away as the flames keep on growing and they close the hatch behind them to keep the fire sealed.
Lev helps AJ out of the pod but they can’t open the door. Harry notices AJ is missing and wants to save him, however the others stop him saying it’s too late. Lev opens a hatch into the cooling unit and tells AJ to hold his breath or the cold will freeze his lungs.
They crawl through the tight space and drop on the other side of the door, so they jump into another corridor right before it explodes. The shuttles are getting ready to leave while a part of the station finally breaks down, destroying other parts in the process. If the shuttle doesn’t move soon they’ll get crushed too.
AJ and Lev run as fast as they can and make it to the shuttle just in time. Both aircraft finally fly off, avoiding at the last second the huge explosion that destroys the entire Russian space station. With only a few hours left, the shuttles continue their journey with 90% of the fuel.
Eventually they make it to the Moon and proceed with the slingshot maneuver, burning their thrusters as the speed goes over fifteen thousand miles an hour. The team suffers the pressure of the gravity forces by yelling in pain, but eventually the shuttles stabilize when they finally see the asteroid ahead of them. The shuttles soon are shaking again when they go closer, flying quickly to dodge the debris on the tail.
The auxiliary boosters are dropped and those hit the debris, causing a small explosion. All this debris makes it hard it for the shuttles to land on the asteroid. Sadly the Independence takes a hit and they lose their thrusters, but there’s nothing NASA can do except hearing their men beg for help.
The shuttle starts going down and is hit again since the pilots are losing control of it. As the team puts on their helmets for life support, the windows begin to break and a bunch of rocks suddenly hit the Independence. It causes so much damage that it sends the pilots flying away and their bodies hit the Freedom.
AJ and Lev rush to hide inside the cargo bay, but unfortunately Oscar and the astronauts get killed when the shuttle begins coming apart. The Independence crashes on the asteroid and everyone thinks that the entire team is lost. The Freedom soon follows and has a safer landing, but the shuttle slides for a few miles and misses the planned landing area, stopping at an impenetrable spot instead.
At NASA, the scientists have lost all communications with both shuttles and Grace has a breakdown over AJ possibly being dead. However AJ and Lev come out of the cargo bay alive and they check on the other bodies. AJ cries for Oscar only to be interrupted by Bear, who miraculously survived on his seat.
The trio gets on their drill and makes a bunch of holes in the wall to blow it open so they can escape. Back to the Freedom team, they take the drill out and start digging on the surface. It’s so hard that it breaks the drill head after only ten feet, so they’re forced to stop.
The astronauts manage to find some signal and regain communication with NASA, but it’s very janky. They replaced the head and start drilling again, but this time the excessive force causes the transmission to blow up and Harry is hit by the shockwave. There’s some kind of metal down there that they’ve never seen before.
At NASA, they discover they’ll only have one more chance to contact the team in seven minutes, and after that they may lose the ability to detonate the nuke at all. At that moment Willie contacts them explaining the drilling may take longer than expected. When Harry tries to interrupt him, Willie shows him a card that says this conversation is confidential.
Harry ignores it and tries to talk to NASA, but Willie starts arguing with him and kicks him out of the room saying bringing drillers was the biggest mistake. NASA loses communication with the shuttle. With only five hours left, the president orders to remote-detonate the nuke in five minutes.
As the army takes over the NASA office the scientists explain blowing the nuke up now won’t have any effect on the asteroid, but he’s ignored. Grace yells in desperation and is removed from the room. In the shuttle, Willie opens a safe to reveal a gun and orders for a secondary protocol.
Harry and the team notices the nuke’s clock has started ticking and Willie comes in announcing they must evacuate. Hound and Max are still outside and Harry refuses to leave without them, so he yells at Willie as he explains an explosion this early won’t help at all. When Harry grabs a tool to destroy the timer, Willie points his gun at him to stop him.
At that moment, the NASA scientists secretly hack into the uplink to disconnect Earth’s systems from the nuke. Willie is distracted by the timer going off and Harry uses the chance to knock him down while Chick does the same with the other astronaut and retrieves the gun. At the same time the army notices the missing connection and brings it up again.
As Hound and Max return to the shuttle, Harry catches Willie with his tool and points out there’s no point in giving up now if they’ll die anyway, so Willie agrees to let them drill again as a last effort. With only a few seconds left Willie and the other astronaut open the panel on the nuke and cut a few cables until the timer is shut down. Then the team contacts NASA again and announces they’ll continue their mission, which the scientists celebrate.
Meanwhile the Independence trio gets stuck in front of a chasm. AJ throws a rock in frustration and seeing it float makes him realize they can jump over the chasm thanks to the reduced gravity. They get in the drill car and speed up to make the jump, which successfully takes them over the chasm.
However they can’t control the vehicle and they crash against some rocks. Thankfully the car destroys them and keeps going, but the thrusters shut down in the process. Lev goes out and discovers the thrusters are frozen, so he starts working on activating them again.
Suddenly a bunch of rocks start flying towards them and Lev has to hold on tight not to be pushed off. After Lev finishes the activation, he climbs onto the front window at the same time the vehicle hits more rocks and starts spinning. By grabbing onto a rope Lev saves himself from falling at the last second and AJ finally turns on the thrusters again, allowing him to regain control.
After destroying a few more rocks, the car lands safely at last. Back to the Freedom crew, they’re working on repairing the drill and Hound messes with the equipment, accidentally activating a machine gun. The fire starts destroying things around them and Harry rushes to turn it off as Willie theorizes Hound is experiencing space dementia.
Suddenly the asteroid starts cracking and an earthquake hits the area. Max tries to shut the drill off, however it seems they hit a gas pocket and the pressure is too much. Flames shoot up before Max can leave and the vehicle starts breaking down.
Soon it’s pushed up and it floats away from the asteroid with Max still inside. Losing all hope, the team tells NASA what happened and soon an alarm goes out around the whole world. People start to evacuate, hiding in bunkers or spending their last moments with their families.
Suddenly a meteorite hits Paris, destroying the entire city in just seconds. As the Pope gives a public speech, riots take over the streets. The scientists at NASA have no answers to give and Grace gets aggressive as she snaps at them.
When Harry’s team gets ready to leave, AJ’s group finally shows up with the other drill. After informing NASA, they tie Hound up and start drilling with only one hour left. The gas pocket starts expelling flames again and Harry wants to pull back, but AJ swears he knows what he’s doing and keeps going.
To his surprise, Harry decides to trust him. After lots of effort and teamwork, they manage to make the hole reach 800 feet. Very carefully they lower the nuke and while they get it in position, the asteroid starts breaking apart.
Rocks fly around them, crashing against more rocks and making them fall around the team. A small explosion sends AJ flying, but thankfully Harry grabs the rope attached to his suit to save him. Debris continues to fall around them, triggering more explosions and killing one of the astronauts.
A huge rock rolls on the ground and the team manages to move out of the way just in time. Afterward they finish setting up the bomb only for Willie to discover that the remote detonator is damaged, meaning the only way to finish this is for someone to stay and activate it manually. Some of them try to volunteer, but it’s decided to draw straws instead.
AJ takes the shortest, so Harry offers to take him down while the others get ready to leave. Once they step out of the elevator, Harry pulls AJ’s oxygen supply and takes the detonator before forcing him back inside. Harry admits he always thought of AJ as a son and gives him his blessing to marry Grace.
While the elevator takes AJ back, Harry gets in the drill vehicle and calls NASA to have a final talk with Grace. They share some finally words of love and cry as they say goodbye. The shuttle is having trouble to take off so Lev pushes the astronaut out of the way to fix it by hitting the system with a wrench.
As the shuttle finally flies away, another earthquake hits the area and Harry is pushed off, losing the detonator. With only one minute left for the asteroid to cross the barrier, Harry crawls back to the detonator and presses the button, so the nuke goes off at last. The asteroid blows up in a huge explosion that makes the shuttle shake like crazy.
Thankfully all the resulting parts miss Earth by 400 miles and everyone celebrates as they watch the bright light in the sky. Moments later the shuttle successfully lands and Grace runs to reunite with AJ while Chick gets to reconnect with his ex and his son. When the wedding finally happens, pictures of the fallen team members are part of the ceremony.