A homicide attacker blew himself up at a funeral Friday for a slain policeman in Pakistan's volatile Swat Valley, killing at least 40 people including the officer's 16-year-old son.

Another homicide bombing on Saturday injured 19 people in the region, officials said.

It was the deadliest attack in the country since the Feb. 18 parliamentary elections. And it was the bloodiest in the Swat Valley since militant followers of a pro-Taliban cleric grabbed control of large parts of the scenic corner of Pakistan's restive northwest.

President Pervez Musharraf sent in thousands of troops in November to reassert government control over the valley. The army says it has retaken most of Swat, but attacks persist and the leader of the uprising, Mullah Fazlullah, remains at large.

About 800 people, including police officials and civilians, were at a government high school Friday for the funeral of senior police officer Javed Iqbal when the bomb exploded, authorities said. District police chief Arshad Majid said at least 40 people were killed and more than 60 were wounded.

Iqbal, the deputy police chief of the Lakki Marwat district, and his driver were killed in a roadside bomb Friday morning. By the time his body was brought to his hometown of Mingora for the funeral, night had fallen.

"Because it was dark, the suicide bomber was able to mingle among the people easily," said Shahbuddin, an assistant inspector of police who was at the funeral.

The explosion occurred just as the pallbearers lifted the coffin to carry it toward the grave, said Shahbuddin, who only uses one name. One of the pallbearers was Iqbal's 16-year-old son Ghazan, who was killed.

"As the coffin was lifted I moved toward the gate but suddenly a big explosion took place, which dashed me against the gate ... It was hell. Everybody was crying for help," said Shahbuddin, who was slightly injured.

Taliban militants have stepped up attacks and taken control of tracts of northwestern Pakistan bordering Afghanistan in the past several years. Last week, a roadside bomb killed 12 people at a wedding party in Swat, once a popular tourist retreat known for its mountain scenery.

Fazlullah leads a banned extremist group that sent reinforcements for the Taliban when U.S. forces invaded Afghanistan in late 2001.

In Swat, he took up arms in July, calling for holy war against the government, and sent thousands of followers to seize a string of towns, scattering outgunned police and erecting "Taliban station" signs outside former police stations.

The uprising was a shocking reflection of how Musharraf's government had lost control of swaths of the conservative northwest.

Also Saturday, a homicide bomber struck a vehicle carrying security forces in the northwestern tribal region of Bajur, wounding 19 people, including some civilians, said Iqbal Khatak, a government official.

He said the attacker was on foot. All the victims were taken to a hospital, where three of them were listed in a critical condition, he said.

Musharraf, a valued U.S. ally in the fight against Al Qaeda and the Taliban, has faced calls to resign since his Muslim League-Q party was soundly defeated in the parliamentary elections. He has refused to step down.

The party of Benazir Bhutto -- the opposition leader assassinated on Dec. 27 -- was the biggest winner in the election, followed by the group led former Prime Minister Nawaz Sharif. Leaders of the two parties hope to form a coalition that would give them the two-thirds majority necessary to impeach Musharraf or curtail his powers through constitutional amendments.

Musharraf came to power in a 1999 coup that ousted Sharif. Although Pakistanis initially welcomed Musharraf, he has become increasingly unpopular amid accusations he has trampled on democracy and the judiciary.