Thirteen policemen and a civilian were also wounded in the attack on Tuesday in Hangu in the North West Frontier Province, where a year ago 40 people were killed by a suicide bomber during an Ashura procession.
Fakkahar-e-Alam, a senior administrator, said the attack came as this year's Ashura procession dispersed.
"A curfew has been enforced in the city and there will be no more processions today," he said.
A senior police official, Mohammad Sharif, said the two people killed were Afghan refugees.
Güncelleme Tarihi: 20 Eylül 2018, 18:16
On the tenth day of Muharram, known as Ashura, Shias beat themselves with sharpened chains during processions to mourn the anniversary of the death of Hussein, a grandson of the Prophet Muhammad, during a battle in Kerbala, a city in modern-day Iraq, in AD 680.
There has been a spate of sectarian attacks in the days leading up to this year's Ashura.
Thousands of people have been killed in sectarian violence in Pakistan since the 1980s due to feuding Sunni and Shia extremist groups.
Shia make up around 15 per cent of the mostly Sunni Muslim nation.