The armed militant attacked the Qasr-e-Sakina Imambargah on Kuri Road.
Three people were killed in the attack, Pakistan Institute of Medical Sciences spokeswoman Ayasha Isani said.
The seven injured have been admitted to hospitals in Islamabad and Rawalpindi, police said.
"The exact nature of the attack is not clear," said a police official.
However, media reports said a suicide bomber tried to blow himself up after security officials confronted him, but his jacket malfunctioned and only partially exploded. He was killed in firing by the security officials.
The military says it has killed more than 2,000 militants during the campaign lauched in June last year.
Taliban militants have increased attacks in Pakistan after government's crackdown on terrorists following the Peshawar school massacre that killed 150 people, including 136 students.
At least five people were killed yesterday after a suicide bomber blew himself up outside the police headquarters in Lahore.
Last week 22 people were killed and over 50 injured when Kalashnikov-wielding Taliban suicide bombers stormed a crowded minority Shia mosque in Peshawar, opening fire and exploding bombs in a revenge attack.
Prime Minister Nawaz Sharif and President Mamnoon Hussain condemned the attack.
