Enemy at the Gate

"Enemy at the Gate" is the twentieth episode of the fifth season of Stargate Atlantis, the landmark 100th episode, and the last episode of the series.

Summary
Todd contacts Atlantis and reveals that a Wraith subordinate has managed to acquire several Zero Point Modules that he has used to power a formidable new hive ship. He urges Woolsey to attack and destroy before it becomes a threat to Atlantis. On board the Daedalus, Colonel Caldwell, Colonel Sheppard and the rest of the team, rush to engage the new hive ship. But the Z.P.M. powered vessel proves itself an impressive opponent, crippling the Daedalus before making a sudden and inexplicable jump into hyperspace.

Puzzled over the Wraith's sudden departure, the team picks up a weak subspace signal in Wraith code. McKay is quick to recognize that the communique was sent, through subspace, from another reality. Once deciphered, their worst fears are realized: the Wraith message contains a familiar set of coordinates -- the hive ship is on its way to Earth! Rodney is able to calculate where the hive ship will drop out of hyperspace before reaching Earth, which they can notify Stargate Command via Atlantis once the communications array is repaired.

The team returns to Atlantis once the Daedalus' engines are repaired, but are dismayed to learn from a video transmission sent by Colonel Ellis that both Earth's BC-304 starships, the Apollo and the new Sunzhou, have failed miserably to stop the Wraith ship, with the Apollo, in bad shape herself, taking on survivors from the Sunzhou. Sheppard interrogates Todd for the location of more ZPMs, which Lorne and his team are able to locate -- Atlantis, now with her full complement of three ZPMs, will return to Earth in a last-ditch effort to defend it.

Sheppard returns to Earth via the Stargate, alone, to command the Ancient weapons platform at O'Neill's request; back on Earth, Colonel Samantha Carter is currently in charge of Stargate Command, and Major Davis informs Sheppard that the Wraith ship has arrived shockingly earlier than anticipated and is now in orbit around the moon, sitting still and doing nothing. Sheppard is able to convince Carter and Davis to let him lead a squadron of F-302's refitted with nukes, which are diverted to intercept Wraith darts sent to destroy the Ancient weapons chair (relocated to Area 51) in advance of the main Wraith attack. The attack succeeds with the chair destroyed, leaving Earth defenseless; Sheppard volunteers to go on a suicide mission to destroy the hive ship from the inside with the nuke on board his F-302.

Meanwhile, I.O.A. dignitaries prepare to escape Earth to the Alpha site (to whom Major Davis quips as "courageous to the end") but discovers the Wraith have overridden Earth's gate. Midway between the Milky Way and the Pegasus galaxies, Atlantis' hyperdrive disengages and Woolsey tries to dial Earth, only to find that it has dialed the hive ship above Earth-- Ronon, Teyla, Lorne, and McKay enter the gate to infiltrate the hive ship. Sheppard successfully infiltrates the hive with his F-302 unbeknownst to the rest of the team. In a desperate battle onboard the hive ship, Ronon is shockingly stabbed and dies from the resulting blood loss; with Teyla and McKay visibly upset, Lorne forces them to leave his body behind.

Back on Atlantis, Zelenka proposes activating a highly experimental and potentially dangerous drive based on the same wormhole technology as the Stargate, with the hyperdrive out of the picture. On the hive ship, just as Sheppard is about to activate his nuke, he is stopped by a radio transmission from McKay who suggests activating it by remote, with the team escaping via the Stargate. Sheppard and the team return for Ronon's body, only to discover Kenny has revived Ronon for interrogation; the team is able to rescue Ronon.

However, Sheppard and his team run out of time as they reach the gate and Sheppard is about to activate the nuke with all of them still onboard, when Atlantis arrives just in time to buy them more time, taking the brunt of the hive ship's assault on Earth and launching a barrage of drones in a dramatic battle. The team manages to escape with the nuke successfully destroying the hive ship, but Atlantis is forced to make a landing into Earth's atmosphere with minimal shields as a result of diverting power to weapons and shields, risking burning up during re-entry.

Everyone at Stargate Command waits for news with bated breath but erupts into celebration when Atlantis lands successfully over water; Carter reveals to Sheppard she is leaving the SGC to command the Pheonix, which has been renamed in honor of General Hammond who has died (in a homage to Don S. Davis, who played the role), and the entire Atlantis team views the Golden Gate Bridge from a balcony on Atlantis as the series ends.

Production

 * Unlike the 100th episode from Stargate SG-1, this will not be a comedy episode, but the producers say they "have something big in mind."
 * This episode will not go out on a cliffhanger and is expected to premiere in January. The first Stargate Atlantis movie will wrap up the storyline.
 * Brad Wright stated: Don't expect a final and total defeat of the Wraith, just because the television series is ending. Some storylines will be wrapped up by series end, but the Wraith will continue to be a presence beyond our 100th episode.
 * Joseph Mallozzi stated: Does Season Five end on a cliffhanger? "Depends what you mean by 'cliffhanger. Not so much. It's a great story that Paul and Joe wrote. It's a terrific script, and there's a 'What now?' aspect of it. That's for sure. But there's no fingers dangling on the edge of a cliff, as we have done in the past."
 * Joseph Mallozzi mentioned in the December 15-21, 2008 issue of TV Guide (pg. 33) that things come to a full closure in this episode and a rogue Wraith leads an an invasion of Earth.