LONDON — They stood hand in hand, the five of them, peering up at the scoreboard with their hearts thumping out of their leotards, wanting to make sure that some cosmic computer glitch hadn’t deprived them of the most resounding victory in the annals of modern gymnastics.

“That was such a surprise to look up and see we won by five points,” said Needham native Aly Raisman, after she’d captained the United States women’s team to a jaw-dropping triumph over the country that once owned the women’s sport. “That’s huge. I thought at last year’s worlds winning by four points was unheard of, so to win by five is amazing.”

The final score was US 183.596, Russia 178.530 and Romania 176.414 with the Chinese, who’d won in their home gym in 2008, finishing fourth, and it was all but over before the Americans took the floor for the finale. Even the Magnificent 7, who stopped the Russians’ streak of 10 gold medals in Atlanta, didn’t win by anywhere near that margin.

“I would say it should be the best one,” national team coordinator Martha Karolyi said when asked if this was the top US squad of all time. “Just because 1996 was in the US and this one was on foreign grounds.”

It was the first time that the Americans had won gold at an overseas Games and it followed silver finishes in Athens and Beijing after they’d also come in as world titlists. This time they went wire-to-wire, starting with three soaring vaults, punctuated by McKayla Maroney’s monster 16.233 that put them up by 1.733 points.

The first of them was landed by world champion Jordyn Wieber, who shook off the disappointment of her failure to qualify for Thursday’s all-around and submitted three solid routines. “I just kind of stayed in my little bubble and got refocused and everything was fine the next day,” said Wieber, who’ll get another golden chance in the event final on floor.

The US team has mastered the art of mentally erasing the board the moment after the scores have gone up. Though they’d beaten the Russians in the qualifying round, the margin had only been 1.434 points. That was too narrow in this sport of slips and wobbles and kerplunks, so the Americans attacked every routine like raptors, winning every rotation but uneven bars, where they finished third.

As expected, the balance beam was where the evening was decided and that’s where Raisman, who’d sat out vault and bars because the team had three better competitors, made her entrance. For the first hour she’d been on the sideline as hugger-in-chief. Now, she had to begin on the most precarious of the four events after being idle for more than an hour.

“You need to keep warm, you need to keep your brain moving and at the same time you can’t move,” said Mihai Brestyan, Raisman’s coach. “I am happy that she stood up there and at the end of the day made no mistakes.”

Following solid routines by Kyla Ross and Gabby Douglas, Raisman’s effort put the US up by nearly 1.3 points, more than they’d been behind in Beijing after three rotations. Barring a major pratfall on floor, the Americans figured to win.

“When the beam was over I had the feeling that we have the medal in our hands,” said Karolyi.

While the Russians were performing like tipsy Wallendas, the Yanks huddled up a few feet away. “We said, just do what we did last year and go out and have fun,” said Raisman, who along with Douglas will try for another gold in the all-around. “Because we will remember this for the rest of our lives.”

By the time the Americans took the floor, all they needed to do was not tumble off the podium. While icon Larisa Latynina, who won a record 18 medals between 1956 and 1964, watched from the stands, the Russians came apart like a cheap Soviet suit. After Anastasia Grishina made two major boo-boos, Kseniia Afanaseva crashed face-first near the end of her routine.

“The Russians had a meltdown,” said Bela Karolyi, who coached the Romanian teams that challenged the USSR’s hegemony in 1976 and 1980.

And the Americans had a cakewalk as Douglas, Wieber, and Raisman put on an exhibition, with the captain landing a thunderous tumbling pass that stomped on the Motherland’s grave.

“I feel that the USA have just proved that they are better than us as a team in general,” conceded former world champion Aliya Mustafina.

Nobody at these Games was in their class. The Romanians are so thin that they brought Athens triple gold medalist Catalina Ponor out of retirement at 24. The Chinese, who were forced to give their 2000 bronze medal to the Americans for falsifying ages and were suspected of doing it again four years ago, played it safe and brought grandmas this time, four 20-year-olds who were nowhere near up to the mark. And the Soviet pipeline that once gushed gold has run dry.

“The Russians were in the international zone shopping today and our kids were in workout,” observed Bela Karolyi. “That is the difference.”

Year after year over the past decade the Americans have been the best team on the planet but until now they didn’t have a Games gold medal to confirm it. Now, the line of succession that began with Mary Lou Retton and continued with the Millers and Pattersons and Liukins finally stands astride Olympus. “I would hope that we will be able to inspire a generation,” mused Raisman. “We all had role models. We all sacrificed a lot but it’s been worth it to become gold medalists.”