The first test of the McKay/Carter Intergalactic Gate Bridge is a success, as Col. Sheppard boards a Puddle Jumper in Atlantis and travels an automated network of thirty-four stargates all the way back to Earth. But McKay, who's observing the test aboard the Daedalus at the network's Midway Space Station, has other concerns: a mysterious ship is racing toward the Daedalus at nearly the speed of light.
With Sheppard back on board, the Daedalus races after the alien ship. McKay and Sheppard are thrilled to discover that it's an Aurora-class warship called the Tria with a crew of genuine Ancients. They left the Pegasus galaxy 10,000 years ago, but their hyperdrive gave out on the journey to Earth. Forced to endure the relativistic time-dilation effects of near-lightspeed travel, they've experienced only a few years' time from their perspective.
The Daedalus transports the Ancients back to Atlantis, where their commander, Helia, commends Dr. Weir for taking care of the city. Then Helia suddenly transfers all of the city's systems to her control and orders the humans to leave now that Atlantis's rightful owners have returned. Shocked, Gen. Jack O'Neill and Richard Woolsey travel all the way from Earth to request that Helia reconsider. Although she allows Woolsey to remain as an ambassador, she reiterates that the Atlantis Expedition and their Athosian friends must depart - immediately.
Solemnly, the humans bid farewell to the city that has become their home. Sheppard's team is hit hardest of all, as its four good friends are forced to go their separate ways: Sheppard and McKay return to Earth, while Teyla and Ronon travel to the new Athosian settlement.
Some time later, as McKay, Sheppard, Beckett, and Weir struggle to readjust to life on Earth, O'Neill returns to Atlantis to give Woolsey some diplomatic backup. But while he's there, the Pegasus galaxy replicators attack the city with stunning force, catching the overconfident Ancients by surprise. By the time the news reaches Earth, most of the city has already fallen.
Landry resolutely dispatches the Daedalus with a nuclear bomb to destroy the city rather than let the replicators find their way through the Gate Bridge to Earth. But Weir, Sheppard, McKay, and Beckett have other ideas. Against orders, they secretly gather weapons, circumvent Stargate Command's elaborate security, escape through the Gate Bridge back to the Pegasus galaxy, and seek out Ronon and Teyla. Then, reunited, the team prepares to take back their city.