The attack took place on the outskirts of Lahore, said Malik Ahmad Khan, the provincial government spokesman. A local police official, Mohammad Afzal, said that 15 other people were wounded in the blast, which damaged nearby shops.

Mohammad Khurasani, a spokesman for the Pakistani Taliban, claimed responsibility for the attack, saying the group sought to target Pakistan's "impure army," which he called a "slave of America." The militant group's chief, Mullah Fazlullah, who is believed to be hiding in Afghanistan, ordered the attack, the spokesman said.

Elsewhere in Pakistan, two gunmen shot and killed a former Pakistani army colonel in southern city of Karachi, said police official Rao Rafiq. Lashkar-e-Jhangvi, a Pakistani group linked to the Taliban and al-Qaida, claimed responsibility in a text message sent to an Associated Press reporter.

Since Pakistan threw its support behind the United States in its war against terror in 2001, militant groups have killed thousands of people in a bid to overthrow the government and install their own harsh interpretation of Islamic law.

Pakistan's military has carried out scores of operations, killing thousands of suspected militants.

Pakistan's army chief, Gen. Qamar Javed Bajwa, paid tribute to the victims of Wednesday's attack and said the census would be completed at any cost.

Rana Sanaullah, a Cabinet member in the Punjab government, said such attacks are being planned and executed by militants in Afghanistan — an often repeated claim by Islamabad.

Kabul denies it is sheltering any militant groups, but various extremist factions launch attacks on both countries across the porous border.

Pakistan launched the national census last month, the country's first in 19 years.

Tens of thousands of data collectors, supported by 200,000 Pakistani soldiers, go door-to-door for the project, which is to be finished by May 15. However, societal conservatism and a lack of women census takers could result in Pakistan's female population being under-represented.