The generator exploded on the second floor of a multi-storey plaza in Saddar market of Peshawar, triggering panic in the area.
Several persons sustained minor injuries, witnesses and police officials said.
Footage on television showed injured persons being helped out of the building by local residents.
The cause of the blast could not be ascertained immediately.
The building had several shops selling mobile phones. In the past, such shops have been threatened by militants for selling phones loaded with music and video clips.