Police say it is remarkable that nobody died when an explosion and fire ripped through a western Sydney supermarket early this morning.

Ten people were injured after the explosion at the two-storey building on Station Street at Wentworthville at about 4:30am.

Eight police officers suffered minor burns and smoke inhalation while rescuing an injured man from the rubble.

The two men who were in the building at the time of the explosion are in a serious but stable condition.

Firefighters had believed two more men were inside the building, but now say that is not the case.

Locals have described the building as an Afghan supermarket with an apartment on top, while fire crews say it was a $2 shop.

Video posted on social media shows the building burning fiercely as screams are heard above the sound of flames.

Witness Katie Facaris saw a man who was stuck under burning bricks.

"He was yelling, 'Help, get me water'," she said.

Police 'just came from everywhere', tried to pull man from rubble

Another witness, Ethan Roberts, said police "just came from everywhere" after the explosion.

"There was another guy who was stuck in the fire, with all the bricks on top of him," he said.

"There was another guy telling him that the guy in the bricks is just going to have to wait until the fire crews get there.

"Then police just came from everywhere. There were probably about seven police officers that were going to get him out but they couldn’t because of the heat, it was just so hot."

The supermarket was next door to the Wentworthville Hotel, which was evacuated but did not catch fire.

It is not clear if the explosion caused the fire, or if the fire caused the explosion.

Fire crews beaten back as fire raged and building fell apart

Fire crews damp down the building after the explosion and fire ( ABC News: Nick Grimm )

"It's very dangerous at the moment because we're unsure of the stability of the surrounding walls," Superintendent Paul Bailey from Fire and Rescue New South Wales said earlier this morning.

He said fire crews tried to get into the building after the explosion but were beaten back "due to the flames and structural integrity of the building as it was falling down around them."

He said the two men rescued from the rubble were very lucky.

"We found them in amongst a cavity of bricks so they've obviously fallen from the top of the building and fallen down and the fact that they've survived I think is a miracle," he said.

The cause of the explosion is unknown.

"We don't know a lot at the moment, we're going to conduct a lot of investigations throughout the day with the New South Wales Police," Superintendent Paul Bailey said.

"We do have explosion debris right across the road, so we know an explosion has occurred but its timing and its cause in relation to the fire is still yet to be determined."

Police praise bravery of officers who went into burning building

Fire crews sift through the remains of the supermarket following the explosion. ( AAP: Quentin Jones )

Assistant Commissioner Denis Clifford praised the courage of the police officers who went into the rubble without protective gear to pull the two men to safety.

"Police have entered the building a number of times in an attempt to rescue a gentleman who was trapped under some rubble," he said.

He said the injured officers were in good spirits with minor burns and smoke inhalation in Westmead hospital.

Earlier police released a statement saying police went to the scene after seeing the fire while patrolling nearby.

"Crime scene officers, detectives and fire investigators are waiting for the scene of a fire to be declared safe before attempting to determine the cause of a blaze," the statement said.

"It's not known whether the explosion was the cause – or a consequence of – the fire.

"Detectives are waiting to speak with the injured men to get a clearer idea of the circumstances leading up to the fire."

Firefighters are not sure if the fire caused the explosion or the explosion caused the fire. ( ABC TV )

Eyewitness says blast sounded like a car crash, was heard 2km away

Eyewitness Ethan Roberts was barely a minute up the road from the Wentworthville Hotel when he felt the explosion.

He says it was so powerful that it damaged shops on the other side of the road.

"When I heard the explosion I thought it was a car crash," he said.

"I ran straight down here, and the whole building had collapsed and was on fire.

"I was here 10 minutes before and the building was fine, I don't remember seeing anything out of the ordinary.

"It was so powerful that it knocked the doors out of the shop across the road and everything."

Local man Alex Balanda says he felt the explosion in his house 2 kilometres away.

"My fence shook and it sounded like someone was trying to break into my house," he said.

"There was one massive bang and then momentarily afterwards there were successive explosions that sounded like gunshots."

"It was an Afghan supermarket. There was a unit above it, it was a two-storey building and....it's all gone now."