Emergency crews have worked through the night in one of the areas worst hit by flooding to protect a power substation serving thousands of homes.
Government emergency committee Cobra had earlier met amid fears 250,000 people would lose power and water if Gloucester's Walham station was lost.
Gloucestershire police said the situation was now under control.
Flooding in central and western England has left at least 350,000 homes without running water and 50,000 without power.
Elsewhere in Gloucestershire, power has been restored 15,000 homes which lost supplies after Castlemeads electricity substation was turned off because of rising waters.
Residents along the Thames in Berkshire and Oxfordshire had been bracing themselves for possible flooding overnight.
The Environment Agency has seven severe flood warnings in place - three on the Severn, two on the Thames, and one each on the Great Ouse in Bedfordshire and the Ock in Oxfordshire.
The agency said the Severn at Gloucester and the Thames at Abingdon and Henley have already peaked.
The Thames will peak at Oxford early on Tuesday, and the Great Ouse will peak at Bedford later in the morning.
Gordon Brown has assured the area of government support if the Walham substation is forced to close.
It is understood the prime minister spoke to Gloucestershire Chief Constable Tim Brain about the threat to the station late on Monday.
The Environment Agency later said the River Severn at Gloucester had peaked 2in (50mm) below the main wall protecting the station, suggesting the worst-case scenario may be avoided.
The armed forces were earlier drafted in to help emergency services build a temporary barrier around the switching station, which also provides power to water pumping equipment.
If Walham is lost it is thought it could take at least five days to get the power back but contingency plans are being examined to provide alternative power and water supplies to customers.
National Grid spokeswoman Sarah Harris said everything possible was being done to stop the station from going down.
The ministerial-level meeting of Cobra came after it emerged that the water levels of both the Severn and Thames have exceeded those of devastating floods in 1947.
Mr Brown has said he will set up a review of the crisis.
Earlier he flew by helicopter over Gloucestershire before heading to the police headquarters where the county's emergency response is being co-ordinated.
Severn Trent Water warned all residents in Gloucester, Cheltenham and Tewkesbury would lose their supply on Monday due to a treatment works being flooded, and the situation is expected to last several days.
Parts of Worcestershire were under 6ft of water and the Army has been deployed to help emergency services provide supplies to people in Upton-upon-Severn.
Warwickshire and Berkshire have also been badly affected and residents at risk of flooding in Oxford were told to leave their homes because water levels were expected to rise.
Some homes in Oxford, Abingdon, Kidlington and Bladon have already been flooded and conditions were expected to deteriorate overnight.
The Association of British Insurers has said the total bill for the June and July floods could reach at least £2bn.
Environment Agency floodline: 0845 988 1188
SEVERE FLOOD WARNINGS IN PLACE
The Severn: Severe warnings for Gloucester, Tewkesbury and Worcester
The Thames: Severe warnings affecting Eynsham to Sandford Lock and also Little Wittenham
The Ock: Severe warnings from Charney Bassett to Abingdon
The Great Ouse: Severe warnings from Turvey to Sharnbrook