There was a mad scramble to move 17th century documents after water started pouring underground.

A royal insider said: “There has always been rumours of a secret Tube line linking Buckingham Palace and 10 Downing Street for the royals to escape, but that’s not true.

“However, there is a foot tunnel linking the two buildings. It’s been used for years to store ancient archive material dating back to the 1600s.

“There was a real fear that the water might flood in and ruin some of this precious material. At one point the water was one wall away so it was real panic stations for several hours.”

Staff also considered moving valuable artworks and pieces of furniture stored for restoration fearing the flood might reach the basement of Buckingham Palace, but the tide was stemmed in time.

However, the calamity meant that half the Palace was left without running water, just as it was preparing to host thousands at this weekend’s festival celebrating 60 years of the Queen’s Coronation.

Lavatories were closed and taps dried up as more than 200 royal warrant holders descended on the palace gardens for a celebration of British industry.

Awash; Workmen tackled the burst water main at the palace

There has always been rumours of a secret Tube line linking Buckingham Palace and 10 Downing Street for the royals to escape

Such is the “keep calm and carry on” mentality of palace staff that none of the visitors noticed water to make up the shortfall being pumped in from a tanker parked in the inner quadrangle.

A source said: “The event couldn’t have gone ahead without the emergency water supplies. It’s all been a bit of a nightmare.”

The Queen appeared oblivious to the crisis as she joined royals, including Prince Charles, Camilla, Sophie Wessex and Princess Eugenie for the event’s opening on Thursday.

Around 75,000 visitors were expected over the course of the four-day festival, which ends today and included evening performances by Katherine Jenkins, Katie Melua, The Feeling, Beverley Knight and Russell Watson.

A Thames Water spokesman said: “Water was re-routed around the network and we have also provided additional support to a small number of buildings with tankers to help maintain water pressure in the area.”