SIALKOT, Pakistan — At least 52 people were killed and more than 100 were injured Sunday evening in a suicide attack after a flag-lowering ceremony near the Pakistan-India border, police and hospital officials said.

The blast occurred near the Wagah crossing, where hundreds had gathered on both sides of the border to watch the pomp-filled spectacle featuring Pakistani Rangers and Indian soldiers that takes place every day at sunset.

Police said the bomber slipped past two security checkpoints manned by Pakistan’s paramilitary Rangers and detonated an explosive vest packed with ball bearings about 500 yards from the parade ground as spectators were leaving the ceremony.

Eleven women and four children were among the dead, said Iftikhar Ahmed, a doctor at Ghurki hospital, less than 5 miles from the border, where many of the victims were being treated. The border crossing connects the eastern Pakistani city of Lahore with the Indian city of Amritsar, the only land crossing between the rival nations.

Tahir Javaid, the director-general of the Rangers, said three of his soldiers were killed and five others wounded.

Most of the victims, he said, were spectators from surrounding villages who had come to see the ceremony.

“I was inside my shop when I heard a huge bang,” an unidentified witness told Pakistan’s Express TV channel. “I rushed out of the shop and saw people crying. There was blood and limbs of people scattered everywhere.”

Security forces across Pakistan had been placed on high alert due to Ashura, a 10-day ritual observed by minority Shiite Muslims to mark the death of Imam Hussain, grandson of the prophet Muhammad.

According to media reports, a banned militant group called Jundallah, which has carried out attacks against Shiites and targets along Pakistan’s border with majority-Shiite Iran, claimed responsibility for the attack.

Jundallah is also affiliated with the Pakistani Taliban, a coalition of insurgent groups battling to overthrow the Pakistani state. Pakistani security forces have launched a months-long offensive against the militants in the country’s northern tribal regions.