A suicide bomber blew himself up on Tuesday at a hospital in a northwestern Pakistani town that has been plagued by sectarian violence, killing at least 23 people, police said.
In other violence posing a fresh challenge to the government the day after the resignation of key US ally President Pervez Musharraf, five soldiers and 13 Taliban militants were killed in a tribal region bordering Afghanistan.
The suicide attack happened as Shiite Muslims gathered to protest over the death of a man in a suspected sectarian attack in the troubled town of Dera Ismail Khan, said North West Frontier Province police chief Malik Naveed Khan.
"There are 23 confirmed dead and up to 20 wounded. We have found the legs of the suspected suicide bomber," Khan told private Geo television, adding that tensions were high in the area after the blast.
Provincial police spokesman Riaz Ahmed said the dead included civilians and policemen who went to the hospital to provide security for the protest.
"A Shiite salesman was fatally wounded in an attack at a grocery store and was brought to the city's district hospital, when there was a blast in the emergency ward," Ahmed told AFP.
Another police official speaking on condition of anonymity said the incident could be linked to sectarian violence.
Meanwhile fighting erupted Tuesday in Nawagai, 25 kilometers (15 miles) west of Khar, the main town in the Bajaur tribal district on the Afghan border, an official said.
"Around 13 militants are confirmed dead in the clashes which continued for several hours," local administration official Mohammad Jameel told AFP, adding that five soldiers lost their lives defending the checkpost.
Army helicopter gunships later pounded the area, targeting militant hideouts, he said.
The official said that helicopters had destroyed the house of the main spokesman for Pakistan's Taliban movement, Maulvi Omar, but the compound was empty and no one was killed.
Pakistani forces moved into Bajaur, a known hub of Al-Qaeda and Taliban militants, nearly two weeks ago. The government says at least 460 militants have been killed since then.
Islamabad has been under intense pressure from the United States to clamp down on militants based near the border.
Pakistan army chief General Ashfaq Kayani arrived in Kabul on Tuesday for talks with Afghan and international military officials, security officials said in Islamabad.
"General Kayani has gone to Kabul to attend a tripartite commission meeting that was already planned," a Pakistani security official told AFP on condition of anonymity.
The Afghan military would not immediately confirm the visit.
The two countries, supposed to be key allies in the US-led "war on terror", have been at loggerheads for the last two years over Islamabad's alleged failure to tackle Taliban militants based in its tribal border regions.
Kabul recently accused Pakistan's military-run intelligence service of masterminding the July bombing of the Indian embassy in the Afghan capital, in which around 60 people were killed.
Pakistan denied the accusations, which were also made by India.