Amid tight security, hundreds of Pakistanis paid their respects at a mass funeral on Thursday for 45 minority Shiites killed in a militant attack on a bus the previous day in the southern port city of Karachi.

Pakistan was observing a day of national mourning and state-run television was broadcasting live footage, showing mourners attending the last rituals for the victims of Wednesday's assault.

The callous attack, in which gunmen stormed the bus with members of the Ismaili Shiite branch, then ordered them to bow their heads and shot them dead, shocked many in Pakistan and prompted Prime Minister Nawaz Sharif to rush to Karachi hours after the attack and order an investigation.

It was unclear who was behind the assault. Both a Pakistani Taliban splinter group and an Islamic State affiliate claimed responsibility for it. Pakistani Sunni militant groups view Shiites as apostates and have targeted them in the past.

According to a statement from the prime minister's office, Sharif appealed on all Pakistanis to "join hands against these barbaric terrorists." He said the whole nation "stands united to eliminate these enemies of Pakistan and enemies of humanity."

Activists from the Ismaili community demanded Thursday that those involved in the attack be quickly apprehended and executed.

"Catch them. Execute (them) the next day," said Piyar Ali, one of the activists at the mass funeral. He asked the government to "wipe-out" militants to ensure that no such attack takes place in the future.

Police say at least six gunmen were involved in the attack -- the deadliest in Pakistan since December, when Taliban militants killed 150 people, mostly young students, at an army-run school in the northwestern city of Peshawar.

The Pakistani Taliban have been fighting for more than a decade to overthrow the government and impose a harsh version of Islamic law, killing tens of thousands of people. They often target Shiites, but attacks on Ismaili community are rare.