Islamabad, Pakistan (CNN) -- Militants armed with guns and grenades attacked a mosque during midday prayers in Rawalpindi on Friday, killing at least 40 people and wounding 83, authorities said.
Several explosions followed by gunfire were heard inside the mosque around 1:30 p.m. local time, according to Gen. Athar Abbas, a Pakistani military spokesman. It was not immediately clear what caused the explosions or who fired the gunshots.
The militants entered the compound by climbing over a wall, said Aslam Tareen, Rawalpindi police chief. Several children and elderly worshipers are among the dead.
The mosque -- frequented by retired and serving military officials -- is in a residential area near national army headquarters. A witness told GEO TV that there were up to 300 worshipers at the mosque at the time of the attack.
This is the first attack in Rawalpindi since a suicide bomber targeted a bank on November 2.
On October 10, militants stormed army headquarters in Rawalpindi, taking several people hostage before security forces killed them.