Inside the space station’s U.S. lab module, the four Atlantis astronauts should have been starting to gather, but they weren’t. Space shuttle commander Chris Ferguson kept eyeing his watch. “Everybody get in here! We’ve gotta be ready!” he yelled. It was the eighth day of the 135th and final space shuttle mission, and President Obama was scheduled for a televised call in just five minutes.

The shuttle astronauts and the six members of the station crew should have been milling in front of the camera, tucking in their shirts and straightening their hair. Instead, they were all still rushing around trying to finish their tasks.

At the last minute, the final person slipped into place—by now they were pros at this floating press conference formation—and the call went through. The president opened with a joke, and told the astronauts how proud he was of them and the shuttle workforce. He asked about a robotics experiment, then said: “I also understand that Atlantis brought a unique American flag up to the station?”

Ferguson gave a little start and his eyes widened. You can actually see it on the video. The flag! There were thousands of tiny American flags tucked into every crevice of the shuttle, souvenirs to be given out later, but the one the president referred to was special. The Atlantis crew had brought it up to the station to leave behind, so that some day, years from now, the next American spacecraft to dock there would be able to retrieve it. The symbolism was important to Ferguson, and he had planned to hold up the flag during the presidential phone call. But in all the commotion he forgot, and he had to settle for describing it instead.

Hardly a big deal, and only a few insiders would even have noticed. Besides, everything had gone pretty much perfectly on this flight so far. With only five days left—five days in the entire 30-year history of the shuttle program—he was finally starting to relax. He was lucky to be here. They all were.

WHEN THE last shuttle astronauts began training in the summer of 2010, there was no guarantee they’d get a chance to fly. The mission had originally been STS-335, a “launch on need” flight that would wait on the ground to rescue the crew of STS-134—the last scheduled flight—in case that vehicle was unable to return from the station. Since the 2003 Columbia accident, NASA had required this safeguard for every launch; there was little likelihood that a rescue flight would be needed.

Behind the scenes, though, agency planners had long considered turning STS-335 into a real mission. With the shuttle retiring, new commercial companies like SpaceX were supposed to take over the job of supplying the station, but their launch schedules had been slipping badly, and NASA faced the possibility of a critical break in the logistics chain. One more shuttle flight—loaded with five tons of supplies—would buy some insurance.

In September 2009, Ferguson, as the new deputy chief of the astronaut office, had been asked to look at what it would take to pull off the additional supply mission from the perspective of crew training and safety. There were several concerns. First, this crew would have no rescue shuttle—NASA didn’t have the money and had no more usable external tanks. In the unlikely case that their orbiter, Atlantis, was disabled, the crew would have to stay on the station until smaller Russian Soyuz capsules could bring them home, one by one. The last person wouldn’t get back for more than a year.

After much study and an outside safety review, shuttle managers were satisfied that four people could pull off a last supply mission. Their training would have to be compressed, and their timeline would be packed. But it was doable. And the four astronauts could begin training before a final decision was made, because a rescue mission to the station had a lot in common with a supply mission; one big difference was the number of astronauts riding the shuttle home.

Before he started working on the plan that would turn into STS-135, says Ferguson, “I thought the last flight had come and gone.” Now, by good fortune, another mission had materialized. His boss, chief astronaut Peggy Whitson, decided that Ferguson, a former Navy test pilot, was the logical person to command the crew of STS-335/STS-135. The pilot chosen was Doug Hurley, a Marine aviator who had returned from his first spaceflight in July 2009, and so had been through training recently. Like Ferguson, Hurley had expected to be on one of the last shuttles; both had been disappointed to be bypassed.

The two mission specialist slots went to a couple of veterans: Rex Walheim, a former Air Force flight test engineer and head of the astronaut office’s spacewalking branch, and aerospace engineer Sandy Magnus, who in the summer of 2010 was detailed to NASA headquarters, working on future mission studies and hoping for another tour on the space station, having lived there for four months—and loved it—in 2008 and 2009. Training for the contingency mission meant giving up her place in line for another station assignment. But she told Whitson, “Use me where you need to use me.”

***

Less than a year later, on the morning of July 8, 2011, the four STS-135 astronauts lay on their backs on the flight deck of Atlantis, awaiting the launch. For the first time in 28 years, there were no astronauts sitting downstairs in the mid-deck.

At T-31 seconds, a voice came over the intercom talking about a failure, and a hold. The clock hadn’t stopped this late in the countdown for years. Ferguson turned to Hurley, in the seat to his right. “Did she say failure?” They looked at each other, and Ferguson grabbed his checklist. The launch controllers on the loop were using their own jargon, slinging acronyms the astronauts didn’t immediately recognize. “Even though the world thinks [the astronauts] know exactly what’s going on at all times with this vehicle, we don’t,” says Hurley. “So it took us a few seconds to figure out, Oh, they’re talking about the beanie cap,” a hood that sits atop the shuttle’s fuel tank and retracts just before launch.

The problem was minor, and in a minute or so, the count resumed. Recalling the incident now, Ferguson notes how efficiently the launch team assessed the situation, made their decision, and moved on, with only minutes left in a tight launch window. “That’s what 30 years of launching the same vehicle does for you,” he says. “You really understand a lot of little chinks in the armor.”

Even among the astronaut crews, there was institutional memory that helped them handle problems quickly. Shortly after liftoff, during the thunderous climb to orbit, a loud klaxon alarm sounded inside Atlantis, a warning that the cabin was leaking air. This particular scenario had never come up in training, and the astronauts began to make the mental switch from routine to emergency. Ferguson, though, had seen this happen before, on his first launch. As Atlantis ascended, its metal structure expanded—they called it “cabin stretch”—and the air inside the pressure vessel expanded too. To the sensors, it seemed like the air was getting thinner—a sign of a leak. From personal experience, Ferguson could assure the others it was harmless, an assessment the ground quickly confirmed. Two weeks later, during the landing, it would be Rex Walheim’s turn to calm his crewmates, when they heard a loud bang on the mid-deck below them. “Oh, that happened on my first flight too,” he told them. It was the toilet door slamming open as the shuttle hit atmospheric turbulence.

Once in orbit, the astronauts stowed their heavy orange launch suits, configured computers, and prepared Atlantis for orbital operations. This had always been a hectic time for shuttle crews, and on past flights, if a couple of the astronauts got space-sick, it was hard for even seven people to keep up with scheduled tasks. That was another benefit of flying only veterans. “Knowing full well that we didn’t have anybody who was going to be throwing up for the first three hours after we got to orbit was huge,” says Hurley.

After two days of playing orbital catch-up with the station, day 3 was docking day. Ferguson had steered a shuttle to the station before—patiently firing little thruster bursts with his hand controller, while keeping watch out the orbiter’s overhead and aft windows. It was slow work, and stressful. Rendezvous was “one of the times that the pucker factor is a little bit higher,” he says, “because you have to be in just the right spot, doing just the right things, or it will cost you an enormous amount of fuel, and embarrassment, to get back to where you really belong. There’s a lot of pressure to put the orbiter in just the right spot.” As Atlantis approached, the view out the window was even more beautiful than he’d remembered. The station, he says, is “the ultimate visual stimulation….an incredible, silvery-gold, living thing.” Atlantis docked as the two vehicles orbited 220 miles over the Pacific.

Waiting at the other end of the docking tunnel to greet the arrivals were Americans Mike Fossum and Ron Garan, Satoshi Furukawa of Japan, and Russians Andrei Borisenko, Aleksandr Samokutyayev, and Sergei Volkov. All had been living on the station for more than a month, and all would help—to varying degrees—unload the tons of supplies Atlantis brought.

Most of the cargo was packed inside a room-size cylindrical module—named Raffaello—that rested in the cargo bay of Atlantis. It held a year’s worth of food, clothes, water, spare parts, and supplies for future station astronauts, all carefully number-coded and packed in pallets or boxy, white fabric bags. Hurley and Magnus lifted the module with the station’s robot arm and attached it to a station docking port. Magnus, the loadmaster, was in charge of the move, which would go on for days.

First, though, came a spacewalk on day 5 to remove a failed pump from the outside of the station and place it in Atlantis’ cargo bay to be brought home. There was also a refueling experiment to install, and other maintenance tasks. Normally a spacewalk during docked operations would fall to the shuttle mission specialists, Walheim and Magnus. But there hadn’t been time to fit a spacewalk in the training, so the NASA planners had come up with something new: The station astronauts—Garan and Fossum—would go outside, and Walheim would help direct them from inside the shuttle.

That had made for an unusual, hybrid style of training. In the months leading up to their mission, Walheim, Garan, and Fossum practiced together underwater, working out each foothold and turn of the wrench that would be needed in orbit. Then, the two station astronauts had to launch, so Walheim continued training after they left. Now, reunited in orbit, the three stayed up late the night before the spacewalk to go over the updated procedures.

When the spacewalkers stepped outside, Walheim, inside Atlantis, felt like he was right alongside them, following every move for six and a half hours. “I sat there with all my cameras set up and my procedures where they needed to be,” he says. “I was ready to go.” When he couldn’t see the spacewalkers out the windows, he watched on the monitors, looking vicariously through their helmet cameras.

With the spacewalk finished, the astronauts turned their full attention to the cargo transfer. For the next three days they unpacked the moving van, each person carrying a container to its designated spot on the station, then returning with something else—a bag of trash, a piece of equipment from an earlier expedition—to be packed in Raffaello for the trip home. It was like two lines of ants, one coming, one going, all day for three days. “We were a machine, man,” says Magnus. Fossum set up a couple of speakers and put on his favorite band—ZZ Top—so they’d have something to listen to as they floated past one another.

As loadmaster, Magnus held the checklist, and the others would come to her if they couldn’t figure out from the codes where something went. Having lived on the space station herself, she knew the system. “The station guys have to go find it later,” she says, “so the ground has to know that food container number 17 went to the JLP, rack number two, station C on that rack.”

She delegated to Hurley the job of unloading and loading Atlantis’ mid-deck. That included the monotonous task of filling bags of water (a byproduct of the shuttle’s fuel cells) to leave behind on the station. “Doug, bless his heart, got stuck on the mid-deck doing that—for days,” Magnus says. “He would start a [water] fill, then wander off into the station to bring something from the shuttle.”

Often, says Ferguson, on past shuttle flights, the commander had assumed a “passive oversight role, and generally didn’t work that hard. I probably was in that category on my first flight as commander.” But on STS-135, he had to pitch in too. At one point, he volunteered for unwrapping duty. For years, the astronauts had argued that the people who packed the cargo on the ground used way too much packing material. They even wrapped towels in foam. The leftover packaging created a major trash problem on the space station, but the packers had their reasons, and the astronaut office never could persuade them to stop.

So Ferguson spent a good part of the space shuttle’s historic final mission unwrapping a load of Russian-made urine receptacles, one by one, so the station crew wouldn’t have to. “They had bubble-wrapped them,” Magnus sighs. “Individually. Fergie spent an hour or two un-bubble-wrapping them, saying, ‘We are not leaving that bubble wrap behind.’ ”

For the busiest part of the move, NASA had arranged with the Russian Space Agency to get help from the three cosmonauts on the station. Normally, the Russian crew members would have stayed on their side of the station during the work day, running their own experiments and following a separate timeline. Now they joined the moving crew. “We had all three of them at one point, coming and going,” says Magnus.

As usual during a shuttle visit to the station, the two crews tried to have dinner together when the schedule allowed. One night it was in the station’s U.S. lab, another night they ate in the Russian module, and on day 7 they crowded into Atlantis’ mid-deck for an “All-American meal” of chicken, baked beans, and apple pie, in honor of the shuttle’s retirement.

“Sasha [Samokutyayev] just loved the space shuttle,” says Ferguson. “He and Andrei [Borisenko] were over there all the time. It was kind of this pilot-to-pilot thing—they just had so many questions: What does this do, what does that do? Everybody’s very proud about the airplane or spaceship they fly, and we really did enjoy showing it off.” The cosmonauts presented the astronauts with a patch commemorating the shuttle’s last visit to the station. “Knowing how difficult it was for them to bring things up in the Soyuz, I was really impressed,” says Ferguson.

As Atlantis’ time at the station wound down, and the crew started to relax about getting the cargo transferred on schedule, the ceremonial moments became more frequent, the mood a bit more reflective. The STS-135 astronauts understood all along that theirs would be a high-profile mission, with lots of time devoted to press interviews. These live public affairs “events” were done from the station, which was better set up for video than the shuttle mid-deck. To all the local drive-time radio personalities asking Ferguson about his favorite baseball team (the Phillies), or Magnus about her zero-G hairdo, or Hurley whether he would miss the shuttle, their answers were considered, even thoughtful, as if they hadn’t just heard another reporter ask the exact same questions five minutes earlier. They all thought it was important to share this last flight with the public.

An even stronger desire was to honor the NASA workers who had trained them, or had built the shuttles or serviced them—an entire culture that after 30 years was about to disappear. This had been powerfully apparent during training. More than once, after a busy day of simulations or meetings at one NASA center or another, people had stopped them to say how proud they were to have worked on the vehicles. Many were about to lose their jobs. “I talked to one guy who had been with Atlantis since it was built in Palmdale [California, in the early 1980s],” says Hurley. “There were a hundred stories like that. We talked to people who said ‘I started working here at Kennedy when I was 18, and worked on every flight’, people who had emotionally, mentally, and personally devoted their lives to the space shuttle program.”

Each night of the mission as they were signing off, Ferguson and his crewmates made an effort to thank the people in mission control—by name if possible. They recorded messages to be played later at retirement parties. One night a request came up to record something for the family of a long-time shuttle engineer who had just passed away. They found the time.

During the busy days on the station, there hadn’t been much chance for reflection, but now that the end was near, the shuttle crew felt it in different ways, and at different times. For Walheim, it happened while they were undocking. As the shuttle pulled away from the station, Ron Garan’s voice came over the radio: “Space shuttle Atlantis, departing for the last time.” At that point, says Walheim, “I was back from the window, toward the floor, kind of by myself, with nothing to do for a couple of seconds. It just kind of got me choked up.”

Now, with just the four of them back in the shuttle, there was one last major task to check off before coming home. NASA engineers wanted documentary pictures of the station taken from a vantage point never seen by other shuttles. So with Atlantis backed off to a safe distance, the station was commanded to turn 90 degrees. It rotated slowly; to the shuttle astronauts the motion was like watching the hour hand of a clock. Then Hurley flew a half lap around the station, up and over the solar arrays, so they could take pictures and video. The maneuver, said NASA flight directors, went “absolutely perfectly, by the numbers.” That’s what the press was told.

Inside Atlantis, “to be honest, it was a little chaotic,” says Walheim. Once the station turned from its normal orientation, the shuttle’s autopilot system lost its lock on reflectors attached to the station’s exterior, which were needed to get range data. Hurley, who was piloting, and Ferguson, who was assisting him, couldn’t tell exactly how far they were from the station. They were supposed to maintain a strict 600-foot distance to prevent the orbiter’s thruster plume from hitting the solar arrays. Walheim grabbed a handheld laser rangefinder, like a highway cop’s radar gun. He couldn’t hit the reflectors either. Each time he failed to get a lock, there was a “nasty buzzing tone. Everybody can hear it, and you’re thinking, Oh crap!”

Ferguson started to worry they might drift inside the 600-foot bubble. He laughs about it now. “I think my voice raised up an octave or two: Rex, I need a mark now! He was like Scotty from Star Trek: The dilithium crystals, Captain—I’m doing my best! And he was!” Finally, the rangefinder got a lock, and they managed the flyaround without penetrating the bubble. But they never did get video—they couldn’t get the camera set up properly.

THE NIGHT before landing, Ferguson was alone on the flight deck. He had just signed off with mission control for the evening, the last such sign-off in space shuttle history. It was July 20, which happened to be the anniversary of the first lunar landing, and Ferguson, knowing the world might be listening, had said to the ground controllers: “Forty-two years ago today, Neil Armstrong walked on the moon. I consider myself fortunate that I was [alive] to actually remember the event. I think there are probably a lot of folks in that room who didn’t have that privilege. And I can only hope that day will come for them, too, someday.”

Like many astronauts, Ferguson is frustrated that since 1969, space exploration has proceeded so slowly. During STS-135, he and his crewmates tried to explain, in practically every interview they did, that no, just because the shuttle was retiring, the space program wasn’t ending. But, he admits, “I don’t think the [political] waters have ever been muddier than they are now. And I think it’s going to take a couple of years for people to understand what we’re trying to do.”

What NASA is doing, in fact—in partnership with private companies—is building new spaceships, even though it’s uncertain where they’ll be sent. The crew of STS-135 is playing no small part in this new enterprise. Ferguson works for Boeing now, as the head of crew operations for the company’s commercial spacecraft program. Walheim is the astronaut office’s point person for the Orion capsule, which will be the first NASA vehicle to leave Earth orbit in more than 40 years. Hurley is the astronaut office liaison with other new commercial spaceship projects. Magnus left NASA in October to become executive director of an aerospace professional society.

But on the night of July 20, 2011, they were still a space shuttle crew, with just a few hours left in orbit. After Ferguson signed off with mission control, the other three joined him on the flight deck. Everything was packed away for reentry, and for the first time in 12 days, there was nothing left to do. For more than an hour, nearly a full orbit, they sat together with the lights off, talking quietly, basking in the moment, with Earth sparkling outside the windows. They saw thunderstorms flashing in the clouds below, the aurora shimmering as they passed over southern latitudes. “There’s so much your senses take in, the vividness of seeing the Earth, hearing the reaction jets fire,” says Hurley. “I remember feeling all was right with the world. You kind of want to bottle that up. Because if you felt like that every day, you’d be doing all right.”

The next morning, things happened fast. Shortly before 5 a.m. Florida time, Atlantis’ engines fired in the direction of its orbital motion to slow the vehicle and begin the descent to Earth. As often happens, the crew scrambled to get in their seats, and Walheim, the last to strap in, was still putting on his helmet as the fiery plasma light show started outside the windows. Sixty-eight minutes after initiating their de-orbit burn, they touched down in darkness at Cape Canaveral. A plaque now marks the spot on the runway where Atlantis’s wheels stopped.

While Ferguson, Hurley, and Walheim were busy shutting down the orbiter systems, they could hear the ground crews outside, starting to safe the vehicle, just as they’d done many times before. Magnus sat there in her lumpy orange suit, rolling her head from side to side, trying to get her neurovestibular system accustomed to gravity again. “I don’t think anyone heard me,” she recalls, “but I said something like, ‘Wow, it’s over.’ ”

Then they all stood up, piled into the Astrovan, and headed out to greet the crowd.