Provincial police chief Akhtar Hayat said the explosions rocked the counter-terrorism office in northwestern Swat valley, which was previously long controlled by Islamist militants before they were flushed out in a military operation in 2009.
His spokesman said in a statement issued later that ammunition caught fire, "most probably due to an electric short-circuit. No evidence of an attack from outside has been established so far".
Pakistani police and military have a significant presence of their counter-terrorism staff in the valley, which has been prone to the insurgency.
The militants also shot at and wounded Nobel Laureate Malala Yousafzai in 2012 in the scenic valley, the birthplace of Mullah Fazlullah, the former chief of the Pakistani Taliban, who was killed in an air strike in neighbouring Afghanistan in 2018.
Other aspects of the explosions are being investigated, the spokesman said.
Most of those killed in the blasts were police counter-terrorism officers, Hayat said, adding that a woman and her child who were passing by the building were also killed.
The regional chief of the counter-terrorism department Sohail Khalid told reporters that the explosions did not appear to be an attack.
"There was a store where we had a huge quantity of weapons, and until now we believe that there might have some blast in it due to some carelessness" he said, adding, "We are keeping all our options open".
A hospital administration said it received several wounded people for treatment, some of them in critical condition.