Gunmen attacked a mosque close to army headquarters outside the Pakistani capital, wounding several people at the end of Friday prayers, police said.
The attack is the latest in a series to rock Pakistan in recent months as the government presses an offensive against al-Qaida and the Taliban in the country's northwest.
Police official Waqas Ahmed said gunfire was continuing in the city of Rawalpindi. At least one explosion was also heard as soldiers cordoned off the area and ambulances arrived at the scene.
Rawalpindi is just a few kilometers from the capital, Islamabad.
Ahmed, who was in the Rawalpindi police command center, said only that an undetermined number of people were being taken to a hospital.