Over 50 people were also injured in the attack in which Kalashnikov-wielding Taliban suicide bombers stormed the Imamia Masjid Imambargah in the posh Hayatabad area here where worshipers had gathered for the Friday prayers, opening fire and exploding bombs in a revenge attack.
The attack comes exactly two weeks after a suicide bombing inside a packed Shia mosque in Pakistan's Sindh province during the Friday prayers killed 61 people, including children, in the deadliest sectarian attack to hit the country
in recent times.
The Tehreek-e-Taliban Pakistan (TTP) claimed responsibility for the attack and warned that it was the first in a series of revenge attacks.
A doctor of Hyatabad Medical Complex confirmed that the death toll had risen to 21 after an injured person succumbed to his wounds.
Taliban spokesman Mohammad Khurasani, while taking responsibility for the attack, said it was a retaliation to the hanging of the militants by the government following the Peshawar school massacre that claimed 150 lives, mostly of students.
Pakistan Prime Minister Nawaz Sharif condemned the latest mosque attack and promised that militants will be brought to justice.
"I think a Zarb-e-Azb-like operations should be launched against the extremists hiding in cities," he said while addressing a gathering of newspapers owners.
Pakistan Army launched Zarb-e-Azb in North Waziristan in June last and had so far killed more than 1,600 militants.
The style of yesterday's attack bore a striking similarity to the December 16 Peshawar carnage, in which the gunmen arrived in a car, set it on fire and broke into the building using a back entrance.