An accidental explosion ripped through a store in northwestern Pakistan on Saturday, killing three people and rattling nerves in a city repeatedly pounded with militant attacks.

Officials initially said the blast in a commercial district of Peshawar was caused by a car bomb, but investigators found no trace of explosives at the scene. Police Chief Liaquat Ali Khan said it was an accidental explosion that went off in a shop with paint stored inside. The exact cause was still unclear.

The explosion damaged vehicles and shattered windows in a wide stretch along a major road. Three people died and 12 others were wounded, Mr. Khan said.

Several people were briefly trapped in upper floors of the building, which also houses several lawyers’ offices as well as shops. Firefighters struggled to put out the flames, and some tried to get into the building using a ladder.

Peshawar has become a frequent target for anti-government, Islamist militants — so officials were quick to assume at first that Saturday’s blast was another attack.

A wave of bombings and suicide assaults have killed hundreds and underscored the resilience of militant networks in Pakistan, which is waging an offensive against the Taliban along the Afghan border but faces U.S. pressure to do more in the war on Islamist extremism.

On Friday, a Taliban suicide squad killed 37 people at a mosque frequented by Army personnel near the capital, including several senior officers.

More In: International | News