Gunmen opened fire at a mosque close to Pakistan's army headquarters during Friday prayers before blowing themselves up, killing at least 36 people, including six military officers.
An intelligence official said 70 others were wounded in Friday's suicide bombing, which occurred in the city of Rawalpindi, just a few kilometres outside the capital of Islamabad.
The official spoke on condition of anonymity because he was not allowed to speak to the media on the record.
A local television station reported the Pakistani Taliban had claimed responsibility.
A military statement said four attackers hurled grenades and then opened fire as they rushed toward the mosque located on Parade Lane in a military residential colony, just a few kilometres from the capital.
Two suicide bombers then blew themselves up inside, while the other two militants were killed in an exchange of gunfire, the statement said.
Military officials killed
Among those killed were a major-general, a brigadier, two lieutenant colonels, one major and a retired major as well as three regular soldiers, military spokesman Maj.-Gen. Athar Abbas said.
The attack began when attackers staged an explosion at a checkpoint at an army installation near the military headquarters in Rawalpindi.
Witnesses said the attackers entered the mosque carrying hand grenades, automatic weapons and ammunition belts slung around their shoulders, and opened fire on the 200 worshippers.
Nasir Ali Sheikh said he saw the attackers as he walked there to pray and witnessed the attack.
"They were killing people like animals," he said. "I couldn't understand what was happening."
The attack was the third in the city of Rawalpindi in nearly two months, and the latest in a wave of violence since the country launched an offensive in mid-October against Taliban militants in the restive area of South Waziristan near the border with Afghanistan.
Officials estimate militant attacks have killed as many as 400 people since October.
In WHOSE sick, twisted, ignorant mind could killing Muslims INSIDE a Masjid be in accordance with Islam? This particular case is just the most recent one - SO MANY of these have happened and I hear nothing from my people.
How in the name of Allah, Most Just, is this Jihad? If you cannot take the life of the non Muslim, non combatant HOW by the name of Allah, Most Just, do you think you can take the life of Muslim CHILDREN in this manner?
Worse, to shed blood INSIDE the Masjid, where the name of Allah, Most Just, is taken is no different than those vile and wretched men who broke into the house of Uthman (RA) and killed him in his own home - the fact that he was Uthman (RA) one of the Asharah Mubasharah made no difference to them because they throw away Allah as they throw away their Islam.
WHAT could you POSSIBLY say on the Day of Resurrection?
WHERE are the Muslim voices condemning these attacks in Masajid and against women and children in marketplaces?
How FOOLISH do we look as a community when we protest carpet bombings by foreign forces but stay silent when a Muslim takes the name of Allah and blows up a Masjid along with its worshippers? Do you not think there is something SERIOUSLY wrong with that?