Pakistani mourners attend funeral prayers for the blast victims at the Shiite Muslim mosque in Parachinar city, the capital of Kurram tribal district on the Afghan border on Saturday. At least 20 people were killed and 40 wounded when a bomb exploded in a market. (Ali Jan/AFP/Getty Images)

At least 24 people were killed and more than 50 injured Saturday morning when a bomb exploded in a busy outdoor vegetable market in a remote tribal town near the Afghan border, security and tribal officials said.

The terrorist attack appeared to be the result of ongoing sectarian violence in the border region between militant Sunni and Shiite factions of Islam. The Pakistani Taliban insurgent group, which is Sunni, claimed responsibility for the blast in a statement.

Dozens of traders and buyers were gathered in the market in Parachinar when the blast occurred. Security officials said an improvised explosive device had been planted in a vegetable crate, and bomb disposal squad officials said it had been detonated remotely.

The population of Parachinar, the central town in the border tribal district of Kurram, is predominantly Shiite. The statement issued by a Pakistani Taliban spokesman, Muhammad Khorasani, said the bombing was carried out to avenge the recent killing of several leaders of the hard-line Sunni group Lashkar-e-Jhangvi, which is banned.

Ikramullah Khan, the top civilian administrator in Kurram, said the explosives had been brought into the district from elsewhere in Pakistan. 

The Lashkar-e-Jhangvi killings took place hundreds of miles south in Punjab Province. Officials said counterterrorism police killed the group’s chief, Rizwan, a.k.a. Asif Chotu, and three accomplices. Chotu was wanted by police in more than 100 killings, and the government had offered a large reward for his capture or death.

Pakistan’s senior military spokesman, Maj. Gen. Asif Ghafoor, tweeted Saturday that the army chief had ordered an emergency evacuation and medical care for the injured survivors in Parachinar. Many were flown by helicopter to military hospitals in Peshawar, the regional capital. 

Ghafoor also tweeted that terrorists “will fail in their attempt to regain lost relevance.”