ISLAMABAD: A suicide bomber killed 41 people in an attack on a Pakistani military convoy passing through a market on Monday as the Taleban claimed responsibility for a weekend raid on the army’s headquarters.

The suicide bomber, who was on foot, jumped onto a military vehicle in Shangla district, near the Swat valley, and set off the explosives strapped on him, security officials said. “The bomber targeted one of three military vehicles that were passing through the busiest market in the district,” top Shangla police officer, Khan Bahadur Khan, said by telephone.

Provincial Information Minister Mian Iftikhar Hussain said 35 civilians and six soldiers were killed and 45 wounded.

The army has largely driven the militants out of Swat and their leader, Baitullah Mehsud, was killed by a missile fired by a US drone in August. The militants are hitting back.

The army said Pakistani Taleban commander Waliur Rehman was behind Saturday’s attack on its headquarters in Rawalpindi.

Commandos stormed an office building near the headquarters and rescued 39 people taken hostage by gunmen after an attack at a main gate of the headquarters. Nine militants and three hostages were killed in the violence in Rawalpindi while the number of soldiers killed rose to 11, with the death of three wounded men, a military officer said.

The 10 attackers had wanted to take senior military officers hostage to demand the release of a “long list” of captured militants, said army spokesman Maj. Gen. Athar Abbas.

Abbas said a telephone conversation had been intercepted between Waliur Rehman and one of his subordinates. “It revealed that this attack was planned in the area of South Waziristan,” Abbas told a news conference.

The leader of the attack, a former soldier who deserted in 2004 and joined a militant group based in Punjab province, was the only attacker captured alive but wounded, Abbas said. The man, identified as Aqeel, also known as Dr. Usman, was from Punjab, he said.

Abbas said that while the Taleban and Punjabi militant groups had links there were no militant “safe havens” in Punjab.

Earlier on Monday, Pakistani Taleban spokesman Azam Tariq claimed responsibility and threatened more attacks. “It was carried out by our Punjab unit,” Tariq said by telephone. “We will take revenge for our martyrs and will carry out more attacks, whether it’s the GHQ or something bigger,” he said, referring to the army’s General Headquarters.

A ground offensive in South Waziristan could be the army’s toughest test since the militants turned on the state. The army has not said when it would begin.

Monday’s blast, the fourth big attack in a week, triggered selling on Pakistan’s main stock market, which fell 1.3 percent. “The market witnessed a correction due to security concerns across the country,” said Furqan Punjabi, analyst at Topline Securities Ltd.