At least 56 people were killed and 194 wounded in a huge blast at a Shia mosque in the northwestern Pakistani city of Peshawar, a hospital official has said.

The blast in the Kocha Risaldar area of Peshawar - around 190 kilometres west of the capital Islamabad - happened moments before Friday prayers, witnesses said.

"I saw a man firing at two policemen before he entered the mosque. Seconds later I heard a big bang," said one witness.

Muhammad Asim Khan, a spokesman for Peshawar's Lady Reading Hospital, said that 50 of those who are injured are in a critical condition.

The death toll is further expected to rise as many of the injured are in critical condition, police and hospital officials said.

The explosion blew out the windows of nearby buildings, and frantic rescuers were seen ferrying the dead and wounded from the scene.

The authorities have not said who may be behind the attack.

"We are in a state of emergency and the injured are being shifted to the hospital," a police officer said.

A senior police official said two armed men arrived near the mosque on a motorcycle and were stopped for a search by police on duty outside.

"They opened fire on the police...and entered the mosque," he said.

Peshawar - just 50km from the border with Afghanistan - was a frequent target of militants in the early 2010s but security has greatly improved in recent years.

Sunni majority Pakistan has recently been battling a resurgence of its domestic chapter of the Taliban, Tehreek-e-Taliban Pakistan (TTP).

A one-month truce last year failed to hold and there are fears the TTP - which has targeted Shia Muslims in the past - has been emboldened by the success of the Afghan Taliban.