A large fire has ripped through Weybridge Community Hospital in Surrey.
Fire crews were called to the blaze at the building, which houses a walk-in centre that is only open during the daytime, late on Tuesday night.
People living near the scene of the fire have been evacuated from their homes for safety reasons and offered refuge inside St James' Parish Church.
The centre has been severely damaged and is not expected to reopen in the near future, the NHS said.
Images shared on social media show the roof of the three-storey all-purpose medical centre engulfed in flames.
There were also reports of several explosions, heard from up to a mile away.
Surrey Fire and Rescue Service said they had eight pumps, two aerial ladder platforms and three water carriers at the scene at the height of the blaze.
Fire crews are still on the scene with smoke still billowing from the remains of the building.
Matt Leisegang, 28, who was evacuated from his home about 100m from the fire, said: "It was about 11.45pm when my wife woke me up and said there was a fire at the hospital.
"We heard people shouting outside and went to look through the window. Within about 15 minutes, the whole of the roof was alight.
"The building is only three storeys, and the top floor was completely engulfed in flames within a short time.
"Within about 40 minutes of the fire, the whole of the top floor was gone. I could only see flames."
Charles Avens, who lives nearby, said: "Suddenly you could see flames leaping up over the back of the houses."
He said as he went to alert some of his neighbours some of the gas canisters at the hospital exploded.
"The noise was absolutely unbelievable, the houses were literally shaking as the gas canisters went up."
St James' Church was opened following the fire and some of the people who had been evacuated spent the night in the building.
Revd Brian Prothero said: "I got a phone call not long after midnight to say that the fire was raging, so I jumped on my bike and came over.
"Within half an hour it was full of people drinking coffee and tea.
"We were doing what ever we could do."
Police said in a statement that a "large number" of residents had been evacuated and that roads around the building, including Weybridge High Street, have been closed and will remain so "for some time".
An investigation is taking place to try to establish the cause of the blaze.
North Surrey Clinical Commissioning Group, community health provider CSH Surrey, and Ashford and St Peter's Hospitals have issued a joint statement.
They said: "Unfortunately the building, which houses two local GP practices, the Weybridge Walk-in Centre and a number of other services such as imaging and physiotherapy, has been severely damaged and will not be re-opening in the near future.
"In the short-term, contingency plans are being put in place for local services including the two GP practices, Church Street and Rowan practices."
They added that people should use walk-in centres at Woking and Ashford and A&E "if absolutely necessary", and said they expected these services to be "very busy" on Wednesday.
At the scene - Peter Stewart, BBC Surrey
The fire is just behind Church Street over the road from Lloyds Bank and Barclays.
There is such a smell of smoke in the air, all the way up to Weybridge station and also the Brooklands race track.
Looking over the roofs on Church Street I can still see smoke over the shops.
There is so much smoke that the police officers who closed Church Road are wearing face masks.