ISLAMABAD, Paksitan (CNN) -- At least 41 people were killed and dozens wounded in a blast Monday at a security forces checkpoint in northwest Pakistan, authorities said.
A girl places flowers at a shrine to army soldiers killed by militants who stormed Pakistan's army HQ.
About 45 people were injured in the explosion in the Shangla district in the volatile Swat Valley, said Syed Altaf Hussein, a senior government official in the area.
The explosion targeted a military vehicle, officials said.
The blast is the latest in a string of attacks in the country.
On Saturday, militants attacked the army headquarters in Rawalpindi, killing 11 military personnel and three civilians, according to the Pakistani military's press office. Nine militants died in the attack.
A total of 39 hostages were freed Sunday morning after being held by five militants at the army headquarters.
In a news conference Monday, the top spokesman for the Pakistani military said Saturday's attack was planned by the Taliban based in South Waziristan.
Gen. Athar Abbas said intelligence agents intercepted a phone call in which Pakistani Taliban commander Wali-ur Rehman was informed about the start of the attack. Rehman responded by calling for a prayer for the operation to succeed, Abbas said.
Abbas said the leader of the operation, who was captured alive, is from Pakistan's Punjab province. Four other militants were from Punjab as well. Five others were from South Waziristan.
During the standoff, two of the militants held 22 hostages in a small room, Abbas said. One of the militants wore a suicide vest connected to a mine and a bomb. He sat in the middle of the 22 hostages. Abbas said this room was the focus of the operation and security forces were successful in storming the room and killing the militant with the suicide vest before he could detonate his bombs.
Military officials said they have tightened security around army headquarters.
The attacks will not deter Pakistan from launching an offensive in South Waziristan, the Interior Ministry said. South Waziristan is one of seven districts in Pakistan's tribal region along the Afghan border. Intelligence analysts consider it a haven for Islamic militants who have launched attacks in Pakistan and targeted U.S. forces in neighboring Afghanistan.
A date for the offensive in the area has not been announced.
The Shangla district east of Mingora is one of the areas where the military conducted search-and-destroy operations earlier this year. Troops targeted terrorist hideouts and reported the arrest of one militant leader and the death of another.
Mingora is the largest city in the Swat Valley, where the Pakistani military is battling Taliban militants for control.
CNN's Reza Sayah contributed to this report.