At least five people have been killed in an explosion at a Sunni Islamic seminary in Peshawar.

Police officer Malik Javed says the blast on Thursday night killed seven and wounded 55 people in the city in the northwest of Pakistan.

The explosion took place as thousands of people had gathered at the Tableeghi Jamaat religious school ahead of the traditional Islamic day of prayers on Friday.

Tableeghi Jamaat adherents generally gather at the sprawling seminary and mosque located on the outskirts of Peshawar on Thursday nights, as well as Fridays.

The officer says there were thousands of people gathered at the seminary when the explosion occurred.

Another police official, Shafqat Malik, said the bomb was 5 kilograms (11 pounds) of explosives stuffed into a canister likely set off by a timer.

There was no immediate claim of responsibility for the attack, but fighters at war with the Pakistani state often have targeted houses of worship with bombs timed to kill the highest number of people.