The episode starts with Woolsey and O'Neill. Woolsey shouts O'Neill's name and O'Neill appears. He says that if he was a Replicator than he would be dead. O'Neill and Woolsey are hiding in the damaged parts of Atlantis where there are no life sign sensors. The Replicators are unaware that they are alive and have killed off all of the Ancients.
Sheppard and his team go through the gate to be met with oncoming fire from dozens of Replicators.To survive they have converted the Jumper's cloak into a shield (We assume they did so between episodes) and on arrival in the gate room, contact O'Neill and tell him to allow two hours until they are rescued. They release an explosive device that destroys Stargate Operations then go into space and pick up Niam. He is frozen and has minimal power. They plan to use him to get a virus to freeze all of the Replicators and rescue O'Neill and Woolsey.
Back on Earth, General Landry knows Sheppard and the others have gone back to Atlantis and tells Chief Harriman to lock out the team's IDC and orders Dr. Lee to supervise a team to destroy the McKay-Carter Intergalactic Gate Bridge, using a Mark IX.
The Replicators realize that the team contacted someone in the base before they detonated the explosives, and resolve to capture anyone hiding. The Atlantis team prepares to go near the city to initiate the virus and the invaders fire drones at them. Sheppard evades them and flies around the city. McKay can't switch from Jumper shield to a cloak. They end up going underwater and into an underwater Jumper bay. They realize that they are trapped because they can't open the Jumper doors and the room is full of water, which starts leaping into the Puddle Jumper.
With time running out, the team contacts O'Neill and asks him to use the failsafe in the flooded control room to drain the water out. O'Neill has to go underwater several times to open the doors since it's a deadmans switch and he has to hold it open. They lose contact and when O'Neill surfaces, he is greeted by a team of Replicators who have captured Woolsey.
Sheppard and the team go to help O'Neill and Woolsey while McKay stays in the Jumper to reprogram Niam. O'Neill and Woolsey are mind probed and the Replicators decide to rebuild the city instead of looking for the rest of the team. The Replicators reactivate Niam and he gets up. McKay has to shoot him with an anti-Replicator weapon. Their entire plan is ruined.
McKay comes up with a plan C for C-4 and will put C-4 in all of the shield conduits. When the Daedalus arrives, they will activate the shield and the C-4 will go off. The Daedalus will nuke the city from orbit. When Sheppard and McKay try to rescue O'Neill and Woolsey, they fail and McKay tells them the plan before having to leave.
While the group puts C-4 around the city, the Replicators activate the city and try to fly. Beckett and Teyla take control of the chair room and Beckett uses drones to fire upon the star drive.
Eventually, they all get captured by the Replicators. The Replicators sense that the Daedalus is coming and gloat in front of the good guys. O'Neill and Woolsey are mind probed again and give the Replicators the plan. When they activate the shields, they are all destroyed. The plan was to actually put the anti-Replicator weapon chips in the shield emitters, turning the shield into a weapon. McKay then faked not being able to open the cell door for O'Neill and Woolsey and told them the fake plan. The team rushes to convince Colonel Caldwell not to nuke Atlantis. Later Weir confronts O'Neill and asks him to let them stay, and he agrees to let them stay in Atlantis.