Following the return of Atlantis to the Pegasus Galaxy six months after the Battle of the Super-hive, the Atlantis expedition discovered that a new Wraith Queen had risen to take power amongst the Wraith, Queen Death. After defeating Queen Death's forces in the Battle of Levanna, Queen Death lured the expedition into a trap where a raid was launched that captured Doctor Rodney McKay. (SGA: "Legacy: Homecoming")
After capturing McKay, the Wraith scientist Dust transformed McKay into a Wraith named Quicksilver. Having no memory, Quicksilver was told that he had been captured by the expedition and experimented upon, resulting in his memory loss. In reality, the Wraith wished to gain McKay's cooperation so they could use his intellect to destroy Atlantis and reach Earth. After a failed attempt to rescue McKay, the expedition learned the horrifying truth about McKay and Dust was killed. Due to the many backdoors McKay had placed within the Atlantis computer system, Jeannie Miller is brought in in an attempt to locate and remove them so that McKay won't be able to hack the computers and lower Atlantis' defenses.
With Dust dead and none of Queen Death's other scientists able to continue his work, Guide suggests assigning Ember to help Quicksilver remember his knowledge about Atlantis without remembering who he really is. Queen Death accepts this proposal and Quicksilver, after a dream where he is in the SGC with an Ascended Doctor Elizabeth Weir, regains some of his knowledge as McKay, including the ability to give the Wraith ships shields and his backdoors into the Atlantis computer system. As a result, Quicksilver suggests a raid on Atlantis to steal the city's ZPM and with it, render the city defenseless. Quicksilver's plan is approved as it gives the Wraith their best chance at eventually destroying the city. (SGA: "The Lost", "Allegiance")
A Wraith invasion force dials into Atlantis from off-world and Quicksilver activates one of his backdoors in the Atlantis computer system. Doctor Radek Zelenka discovers that Quicksilver is using the backdoor to shut down internal sensors, power to the Control Chair and the Stargate shield and he also can't shut down the Stargate itself. As Zelenka realizes that the backdoors are shutting down their security systems, Lt. Colonel John Sheppard calls for security teams to come to the Gate Room and warns the city over the intercom of the threat, telling all security teams to be on alert. Despite his best efforts, Zelenka is unable to stop McKay's programs and the shield shuts down.
Knowing that they are about to be invaded, Sheppard, Major Evan Lorne and two Marine security teams get into position for when the Wraith come through the Stargate. Finally, moments after the shield collapses, the Wraith invasion force starts coming through the Stargate. The Marine teams open fire immediately, killing the first Wraith to come through, but the ones following them simply step over the bodies of the dead Wraith and keep coming. Some of the Wraith warriors hit by the FN P90 Personal Defense Weapon fire don't fall and more and more Wraith make their way through the Stargate. As another security team joins the two fighting the incoming Wraith, Sheppard calls to Zelenka that they need the shield back up but Zelekna struggles to do so and activates the city-wide lockdown to protect the other residents of Atlantis. Eventually, several Wraith Commanders, amongst them Quicksilver, Ardent, Wakeful and the scientist Ember arrive as well as Zelenka struggles to get back control of the city's systems. Airman Salawi warns Zelenka that while the lockdown is complete, the Atlantis transporters are still online. Checking the computers, Zelenka discovers that some of the transporters are indeed still online and some of the doors hadn't properly sealed themselves when they activated the lockdown of the city. Desperatly, Zelenka tries to enact a program devised by himself and Colonel Samantha Carter to hopefully kill some of McKay's subroutines without success. As Zelenka tries, he is nearly hit by a stunner bolt but is saved by Salawi. After Zelenka confirms to Sheppard that he can't get the shield back up, Sheppard orders him to get everyone out of the Control Room as they can't hold the Wraith back and then to pull the ZPM as well. Following Sheppard's orders, Zelenka leads Taggert, Mcmillian, Salawi, Martinez and Neumeier out the rear doors where they are met by a security team led by Captain Laura Cadman. However, as they make a break for the doors, Taggert is stunned by the Wraith and presumably killed afterwards After being told they need to pull the ZPM, Cadman assigns five men to help Zelenka reach the ZPM Hub where another team is already located.
As the invasion continues, Ronon Dex uses a transporter to reach the mess hall level where he is met with a security team made up entirely of young Marines with no experience fighting Wraith. PFC Washington, the acting head of the team, warns Ronon that the mess hall level is not locked down as the security doors on that corridor aren't closing and there's still access to two stairwells. Knowing the Wraith are nearby and if they get past the team they can get to the infirmary on the level below, Ronon leads the team to the stairwell heading up and after hearing the Wraith pounding down the stairs, calls for Teyla to help them. However, Teyla lets Ronon know that all of the security doors in the residential areas have sealed and Carter has informed her that all the external doors near the piers have sealed as well. While Ronon asks about the Daedalus and the George Hammond beaming in people to help, Teyla informs him that the Wraith have deployed a device within the city that is broadcasting their jamming code and blocking the ships ability to beam people in or out. Knowing there is nothing they can do about that, Ronon suggests that Teyla try the transporters before switching his particle magnum to stun in case its a security team and not the Wraith on their way down the stairs. Ronon fires a shot up the stairs and the Marines do the same. Before Ronon can tell them to hold their fire, he sees that coming down the stairs is a Wraith Commander, proving that its the Wraith on their way down, not a security team. Ronon switches his weapon to kill and shoots the Wraith Commander in the leg and then shoots him again as he falls down the stairs. As the Wraith warriors start coming down the stairs, Ronon pulls one of the Marines out of the way of stunner fire and orders him not to let the Wraith get close. The Marines open fire on the Wraith, causing one to fall heavily and foul the shots of the Wraith around him. At the same time, Ronon shoots the Wraith Commander twice more with his gun, killing him and orders the Marines to shoot the Commander if he rises again. Together, Ronon's team shoots the Wraith as they come down the stairs, taking advantage of the fact that without a Wraith Commander to direct them, the warriors simply rush down the stairs into their fire. As the fight continues, one of the Wraith jumps from the stairs on to the Marine fighting next to Ronon, but before the Wraith can kill the young man, Ronon shoots it, kicks it off the man and shoots it twice more when the Wraith gets back up and then shoves his body towards the stairs as another obstacle for the Wraith coming down. Realizing that they are going to be overrun, Ronon orders his team down the stairs to the infirmary level and calls for any security team that can hear him that they need someone covering the South Tower stairs on the infirmary level. When Sheppard responds, Ronon tells him that they have about a hundred Wraith trying to come down the stairs and they had to give up the mess hall level. As Sheppard tells them to hang on, Ronon's team gets into positions on either side of the staircase and Ronon orders them to just keep shooting the Wraith that come down.
In the Gate Room, Sheppard checks on the situation to find that most of the Wraith are still in the area with the Wraith warriors covering approaches while the Wraith Commanders are in the Control Room, presumably consolidating their control of the Stargate and Stargate shield. Sheppard then pictures the situation and realizes that the attack on the stairs makes no sense as it would make more sense to bring in more troops and make sure that the humans can't get back control again. Sheppard realizes that this means that the stairway attack is most likely meant to draw attention away from something and tries to see if McKay is in the Control Room. While Sheppard spots three Wraith at the control boards before a stunner blast makes him duck away again, he doesn't spot McKay and has Lorne take a look. Lorne is able to confirm that McKay is not amongst the Wraith in the Control Room and a horrified Sheppard realizes that the way the lockdown is set up, the transporters that aren't locked out and the diversionary attack is all so that McKay can steal the ZPM. Sheppard warns Zelenka, who has reached the ZPM room, that McKay is coming for the ZPM and orders Lorne to stay and cover the approaches to make sure McKay can't get back in. Taking half a dozen men with him, Sheppard departs for the ZPM room.
Accompanied by Ember, Ardent, Wakeful and several Wraith warriors and carrying a laptop stolen from the Control Room, Quicksilver leads his team to the transporter that he has excluded from the lockdown that will take them to the ZPM room. At the urging of Ember, Quicksilver sends Ardent and several warriors through the transporter first to ensure that the way is clear. After two groups are sent, Ardent reports back that they have secured the hall, but there were human soldiers and more in the ZPM room who are fighting hard. As Wakeful questions whether or not this is worth it, Quicksilver enters the transporter and has a flash that what he's doing is wrong, some of his true nature shining through. Knowing that Queen Death is depending on him to get the ZPM, Quicksilver tells them he's fine and transports them to the hallway near the ZPM room.
At the same time, Zelenka reaches the ZPM room where the team guarding it has heard the news and a sergeant named Hector takes a team to secure the transporter. Zelenka informs Lieutenant Sabine that he has to pull the ZPM as they believe the Wraith are after it and Sabine orders him to hurry and reminds Zelenka that there is only one way out. Before Zelenka can finish, Sabine's men start battling the Wraith in the halls and Sabine arms Zelenka with a P90. As Sabine ducks out to join his men, Zelenka stops his work, erases his password and backs out of the access screens. As Zelenka takes cover, the Marines guarding the ZPM room fall to the Wraith and Quicksilver enters to steal the ZPM. Zelenka threatens Quicksilver with his P90, trying to convince him to stand down and horrified by what has been done to his friend. Zelenka tries to talk Quicksilver down and come with him to get help, but Quicksilver refuses, offering Zelenka his life instead if he puts his gun down. As the two argue, Ember enters the room and stuns Zelenka with a Wraith handblaster. Ember tells Quicksilver that while they hold the hall and the transporter for now, some of the humans got away and they have received a report that they are regrouping. Injured, Ember goes to feed on Zelenka, but Quicksilver feels a jolt of panic, presumably some of McKay's residual care for Zelenka surfacing and he stops Ember from feeding on him, claiming that they don't have time and he needs Ember's help. With Ember watching the readouts for him, Quicksilver removes the ZPM and places it into a protective casing. They then depart the room with the ZPM, leaving the unconscious Zelenka behind.
Sheppard's team enters a transporter and attempts to use it to reach the transporter near the ZPM room without success despite both transporters being active. Examining the transporter map, Sheppard spots that there are two transporters active on the same level way below the ZPM room and realizes that McKay set it up that way so that one would work for the rest of the city and the other only connected to the transporter near the ZPM room. After trying one without success, Sheppard is able to send his team to one of the active transporters on that level and leads them towards the second one to use it to reach the ZPM room and McKay. As the team makes their way towards the second transporter, Sheppard attempts to contact Zelenka without any luck. As they near the second transporter, it activates and Sheppard realizes that they are too late to stop McKay from stealing the ZPM. Taking what little cover there is, Sheppard hits the Wraith with a stun grenade as they emerge from the transporter, blinding them and causing one to stumble to his knees and hopefully get in the way of the others. As the Wraith blindly fire their stunners, Sheppard orders his team to try to take the rest of the Wraith out. While the Marines fire, the warriors remain dazed by the stun grenade but the Commanders recover quicker and one is able to stun a Marine who is pulled by Airman Grieg to safety. As Sheppard hesitates to shoot Quicksilver, he begins to recover his vision and recognizes Sheppard as the one who killed Dust and fires at him specifically and sends the recovering warriors after him as well. Another Marine falls under stunner fire while a warrior feeds on Grieg even as Sheppard tries to kill him to save the helpless airman. As the remaining Marine that is standing grabs the warrior and pulls it back, Sheppard shoots it in the head, killing it but too late to save Grieg. As the surviving Wraith reach the second transporter, Sheppard orders the last airman to shoot them despite his reluctance because of McKay being with them. The airman misses Quicksilver, hitting one of the other Wraith who shoves Quicksilver in followed by himself. Wakeful is killed in the firefight, but Ardent, Quicksilver, Ember and two warriors are able to escape through the transporter, leaving two warriors behind to quickly be killed by Sheppard and the remaining Marine and airman.
After the firefight, Sheppard orders his surviving team members to fall back into the transporter and contacts Lorne to warn him that McKay was able to get the ZPM and is probably on his way back to the Stargate with it. Lorne tells Sheppard that they have managed to retake the Control Room and are trying to get someone up there who can get back into the computer. Sheppard warns Lorne that Zelenka isn't responding to his radio and not to let McKay get through the Stargate.
Lorne alerts the security teams in the reclaimed Gate Room that Wraith are about to arrive through the transporter and they are to use whatever force is necessary to stop them. The teams open fire when the transporter activates, but it is Sheppard's team, not the Wraith. Lorne realizes that if McKay had learned that they had retaken the Gate Room, he wouldn't head there and figures out that the Wraith are likely headed for the Jumper Bay. Lorne orders a security team to the Jumper Bay over the radio and for them to find someone to get back into the computer systems and keep the Wraith from dialing out. Reaching the Jumper Bay, Lorne takes cover behind a Puddle Jumper that is under repair and he spots the Wraith coming out of the transporter across the way. Not having a good shot, Lorne decides to get close enough to shoot the ZPM case out of Quicksilver's hands and is informed by Sheppard that he has teams on their way to join Lorne. Sheppard tells Lorne that he's right behind the teams and over Lorne's objections, orders him to get one of the Jumpers in the air to try and cut the Wraith off. As Lorne heads for a Puddle Jumper, the Wraith take notice of the security teams and the surviving Wraith Commanders and two warriors turn to face them. Lorne attempts to shoot the ZPM case out of Quicksilver's hands, but he manages to keep hold of it and open the rear hatch of a Puddle Jumper. As one of the surviving Wraith covers Quicksilver, Lorne shoots him, but Quicksilver, Ember and Ardent make it inside of the Puddle Jumper while one of the warriors is killed and the other starts to fall. With everyone distracted, Lorne makes his way into another Puddle Jumper in hopes of using it to stop the Wraith. However, before he can fully power it up, Quicksilver rams Lorne's Puddle Jumper with his own stolen Puddle Jumper, sending Lorne's Puddle Jumper skidding halfway across the Jumper Bay floor, severely damaging it and seriously injuring Lorne. As Sheppard heads into the Jumper Bay, the incoming wormhole is shut down and Quicksilver uses the stolen Puddle Jumper's DHD to dial out. In a desperate attempt to stop the Wraith escape, Sheppard takes one of the other Puddle Jumpers into the Gate Room, but the Wraith are able to use the stolen Puddle Jumper to escape through the Stargate before Sheppard can stop them.
After the Wraith are gone, Sheppard lands the Puddle Jumper in the Gate Room and tries to contact Lorne, learning from the security teams that Lorne is down and they are trying to get a medical team to him. Sheppard orders the Marines who are still on their feet to guard the Stargate with too many down, stunned or dead. Airman Salawi returns to her post and after she confirms they can dial out, Sheppard orders her to dial the Pegasus Alpha Site and to keep doing so until he orders otherwise, not wanting to risk someone dialing in while their security systems are down. Sheppard tries again to contact Zelenka who has recovered from being stunned and is already working on restoring their control of the city's computer systems. Sheppard warns Zelenka to hurry up and get the security doors down so the medical teams can get to the injured and contacts the security teams to warn them that they may still have Wraith loose in the city. Sheppard contacts Teyla to have her determine if there any Wraith left and she tells him that they are safe, but she is locked in a residential level. Following the escape of Quicksilver's group, the Atlantis expedition is able to eliminate any surviving Wraith, including the ones who attacked Ronon and his team. (SGA: "Allegiance")
Following the raid, Atlantis is left effectively defenseless without a ZPM to power Atlantis' shield or the Control Chair. The raid also proves that the Wraith possess the ability to lower the Stargate shield at will through McKay's backdoors so a mechanical iris is created, such as the one on the Earth Stargate and controlled manually so that the Wraith cannot override it by hacking into Atlantis' computer systems. Of those who survived the raid but were injured, Anders, a soldier that had been badly fed on before his buddies killed the Wraith warrior, dies leaving ten dead and twenty-four injured. Most of the injured suffered minor injuries such as being stunned and falling down stairs and some minor injuries from hand to hand combat as well as a scientist who suffered an allergic reaction to something he was locked in a room with. Of the three who are seriously injured, Lorne suffers a concussion and a broken leg but will be fine while Rizkala is doing better than expected and likely won't need surgery. However, Jovell's wrist was shattered and he needs another surgery on Atlantis and then to be transferred back to Earth. With that out of the question, Jovell is instead transferred to the infirmary on the Daedalus so that he can return to Earth on the ship when it departs.
Bolstered by the success of the raid, Quicksilver begins working on energy shields for Wraith ships and using the stolen ZPM as a power source for the Wraith. Queen Death also attempts to attack through the Stargate twice more, but the new iris blocks the attacks, leading to the deaths of over thirty Wraith, including Queen Death's own consort, Sky. The lack of a ZPM leaves Atlantis vulnerable to a space attack by a hive ship and a Wraith cruiser, but the Daedalus and the George Hammond are able to fend off the attack. (SGA: "Allegiance")