It was just after 9 am on a sunny Saturday last June that the Millennium Bridge first began to wobble. Roger Ridsdill-Smith, the young engineer who had been involved with every aspect of the project since his famous paper napkin sketch of a blade of light had so impressed Norman Foster and Anthony Caro, was waiting for the start of a sponsored walk. As the bridge began to fill with people, he spotted the first sign of movement. 'It happened quite fleetingly, but you could tell it wasn't just a judder; it was a resonant movement. 'I thought, 'That's interesting', but as the numbers thinned out, the bridge calmed down again.'

Then, at lunch time when the bridge finally opened to the public; the crowds swarmed on from both ends. And that's when the bridge really started to move. All 690 tons of its steel-and-aluminium deck began to sway left and right like a giant, executive desktop toy, so much so that pedestrians, suspended above the Thames on slender steel cables, began to clutch at handrails to steady themselves, and throw themselves against the sway, to stay upright. As they did, so the swings began to get increasingly violent.

Ridsdill-Smith and the police working on crowd-control looked at each other. In his mind, Ridsdill-Smith went back over all the calculations, all the safety assessments, all the wind-tunnel tests, even the giant hydraulic tank in Canada used to measure resistance to water. None of them had predicted anything like this. This was simply not supposed to be happening.

All his experience as an engineer told him that the bridge ought to be stable and that it was certainly safe. But even he must have seen an image of the great Tacoma Narrows suspension bridge near Tacoma, Washington in 1940, shaking itself to pieces, flashing through his mind.

'We asked ourselves, "Is it dangerous?" You could see that the movement was self-limiting. Beyond a certain point, it simply becomes impossible to get any more people on the bridge. As it gets fuller and fuller, people stop moving and the effect subsides, long before structural safety limits are reached. We knew it wouldn't fall down, but suppose granny takes a tumble and breaks a hip?'

The next day, Nicholas Serota lent the bridge his security staff from the Tate to limit the numbers crossing at any one time. But the wobble didn't go away. The Millennium Bridge Trust hesitated for 24 hours before making the decision to close it altogether.

As engineering disasters go, the great wobbly bridge fiasco might seem pretty tame. But to see such a high-profile design closed down so soon after opening was a humiliation for Arup, the fiercely proud engineers who have made everything from the Sydney Opera House to the Hong Kong and Shanghai Bank possible. They could build skyscrapers and nuclear-power stations all over the world, but here, in their own backyard, they were conspicuously failing to make a simple footbridge stand still long enough for people to stroll across it.

What made their embarrassment so irresistible to the more pedantic of their fellow engineers, who rushed in to make judgments about what had happened, was that they seemed to have brought it on themselves. The word was that they had allowed Foster, an architect determined to make his mark on the bridge, push them into flouting the sensible limits of design. 'Of course this bridge was going to wobble, just look at it,' was the consensus. With its low-slung outriggers and its very flat profile, the 'blade of light' looked like no other bridge. It was presented as a piece of typical, too-clever-by-half arrogance. Stray too far from tried-and-tested traditional designs and you'll get in trouble was the subtext of much of the debate.

To the enormous relief of both Arup and Foster, it turns out that the striking looks of the bridge have nothing to do with the causes of the wobble. Arup's analysis has been checked by two independent engineers and three university departments.

'It's not what is different about the bridge that caused the problem,' says Tony Fitzpatrick, who has lead the Arup team struggling to find a solution. 'Every issue about the bridge that was innovative was properly researched and it worked perfectly. What hit us in the back of the head was that bit of the bridge that was the same as every other long-span bridge. We assumed it would work like other bridges have until now; that was the mistake, but there has to be a first time for everything.'

What Arup eventually discovered was a previously misunderstood phenomenon. Once the number of pedestrians on a bridge passes a critical mass, their footsteps start to make it move and the more that they react to that movement to stay upright the more the bridge shakes. It could potentially effect any pedestrian bridge over a given length. Fitzpatrick believes that there are least 70 such bridges in Britain alone, with hundreds more around the world.

'We are not ashamed,' says Fitzpatrick, who is presenting Arup's findings in a guidance note to John Prescott's DETR. 'We want the full story to be out there. We are very clear about what we have done; we are happy for others to judge us. Any conspiracy to keep quiet about the bridge only makes us look worse. We have had only one thing on our agenda - to get the bridge open. I just want to be allowed on the bridge to fix it.'

As soon as the bridge closed, Arup began talking to the world's footbridge experts in Japan and Germany. At the same time, they did urgent checks to see if the bridge had been built exactly as they had specified - it had - and then they looked yet again at their own calculations to see if there was any elementary mistakes in the numbers. There weren't.

All bridges are liable to move. Their weight and structure keep them still to a certain extent, but get enough people walking across a bridge and all the natural damping is cancelled out; then the next few footsteps will set it wobbling violently. It's not a gradual effect. Arup found it's all or nothing. 'Put 1,000 people on a bridge and it will seem to be OK. Put 1,100 and it starts to wobble,' says Fitzpatrick.

Arup discovered a number of bridges which had suffered from the problem, and every one of them looked utterly different. There is a high-level suspension bridge in Tokyo, completed in the 1980s, that had a makeshift damping system retrofitted after its opening; a 100-year-old steel truss bridge in Canada that never moved a millimetre in its entire life, until the day of the firework display on its birthday that attracted so many pedestrians that it began to wobble. Then there was was the Pont Solferino, a graceful arched footbridge across the Seine which stayed closed after its opening, ostensibly because its surface was slippery. This, too, turned out to be the victim of wobbly-bridge syndrome. Fitzpatrick hints at a cover-up. 'If the engineers involved with some of these cases had been as open about their bridges as we are being now, the problem would have been resolved long ago.'

The best news from Arup's point of view was the footbridge linking the National Exhibition Centre in Birmingham to its neighbouring railway station with all the grace and subtlety of a sledgehammer. This was a design clearly untroubled by the least vestige of aesthetic ambition. Yet it, too, suffered from wobbly-bridge syndrome. The avant-garde was off the hook.

Why had none of these cases forewarned Arup? Fitzpatrick's answer is that they were never reported to the people who write the codes that bridge designers must follow.

Who is to blame? After the few ill-judged words uttered by Foster to the mob of reporters besieging his office on the day of the bridge closure, the various members of the design team are going out of their way to be nice about each other. Foster now says: 'You can only use the word blame in a situation in which somebody says, "My God, we missed that code, or didn't make that test which anybody else would have done". That's not what happened here. If you look at the record, much more was done for this bridge than you would reasonably expect. Nobody could ever have anticipated that it would happen to the bridge. In a sense, it is a consequence of its popularity.'

Fitzpatrick is clear that responsibility for the bridge is Arup's. 'Norman made it look more people friendly; he made it more sensual than we would have done on our own, but the concept was an engineering one. It certainly wasn't a case of Norman forcing us to make something work.'

Once the final signatures are added to a £5 million financial settlement for the bridge (this will avoid any legal action against the design team), work can start on ensuring that the wobble is eliminated. It will involve fitting a pair of X-shaped braces under each of the structural bays under the bridge, along with 37 viscous dampers (the kind of large shock-absorbers you might find on a truck), and another 50 tuned mass dampers. These are heavy blocks that sit in baths of oil and are connected by springs to the structure. When the bridge starts to move, the blocks absorb the energy triggered by pedestrians and stop the wobble. It's all been done deftly enough for the additions to look like part of the original design.

How much long-term damage has been done by the bridge's closure? Arup are hoping that their reputation will emerge intact. They were just unlucky to be the first people to face a previously unsuspected problem, just like the engineers who designed the Comets that kept falling out of the sky because of stress fractures that nobody had predicted, or the engineers who built the wartime Liberty ships that kept sinking because nobody could predict the behaviour of the welds used to put them together.

And as far as Tate Modern, prime mover in the original bid to build the bridge, is concerned, director Nicholas Serota says: 'It doesn't appear to have deterred visitors from coming, but we were disapppointed that it had to close. The bridge is a symbolic link to the City and it's great that they have found a solution.'

Fitzpatrick says he is looking forward to reopening day in six months' time. 'We shall go to watch and enjoy the opening,' he says. One of his more cautious colleagues, the engineer who helped the Atomic Energy Authority test what happened when a train travelling at 100 miles a hour crashed into a flask of nuclear waste, is a little more circumspect. Asked how confident he is about the bridge, he tells you about the day of the nuclear test. 'At the last minute, once the train had started to gather speed on the test track, one of the AEA managers turned to me, and said, "Are you sure it's going to work?" I had to think for a minute before I answered.'