Suspected fighters had opened fire on security forces in the market before the blast, police said.
"We arrested three militants from a car in the morning, other militants hiding somewhere in the market started firing on security forces injuring two paramilitary personnel," Jamil told the AFP news agency.
He said that troops returned fire and arrested another fighter wounded in the firefight.
Troops launched a search operation after the shooting and tried to arrest the two would-be suicide bombers but one managed to detonate his explosives vest.
A curfew was imposed in Mingora after the explosion.
Swat has seen a spate of killings of tribal elders in recent weeks, raising fears that Taliban fighters are reasserting their control over the region less than a year after the army claimed victory in an offensive to push them out of the area.
The military said the offensive destroyed Taliban bases and killed hundreds of fighters, but some analysts have said that the fighters simply chose to flee to return to fight at a later date.