KABUL, Afghanistan — A bomb attack targeted a group of lawmakers in northern Afghanistan on Tuesday, killing at least 28 people, including five parliamentarians, officials said. Death tolls varied widely in the confusion of the attack, which also wounded dozens of children.

The bomb exploded outside a Baghlan sugar factory as the lawmakers were about to enter. The blast struck children, elders and government officials gathered to greet the visiting delegation of 18 lawmakers from the lower house, officials said.

The Ministry of Interior said at least 28 people were killed in the blast, but a doctor at Baghlan's main hospital, Dr. Mohammad Yousuf Fayez, said dozens of bodies may also have been left at the blast site and collected by families, meaning they would not be counted officially. Earlier, a high-ranking government official said 64 people had died.

At least 42 schoolchildren were among 81 people wounded, Fayez said.

"The children were standing on both sides of the street, and were shaking the hands of the officials, then suddenly the explosion happened," Fayez said.

Shukria Barakzai, a lawmaker, said 18 of the 249 lower house parliamentarians had traveled to Baghlan province, and that 13 were dead or "in danger."

The province of Baghlan lies about 95 miles north of Kabul.

President Hamid Karzai's office confirmed the deaths of five parliamentarians.

"This heinous act of terrorism is against Islam and humanity and I condemn it in the strongest possible terms," Karzai said in a statement. "It is the work of the enemies of peace and security in Afghanistan."

The attack is among the deadliest in Afghanistan since the 2001 U.S.-led invasion. Taliban bombers have killed regional governors in the past, but never have militants killed so many high-ranking officials in one attack.

A U.S. military spokesman said the blast was the same kind often carried out by the Taliban. Lt. Col. David Accetta , who condemned "this kind of terrorist and criminal attack," said he had no information indicating al-Qaida was behind the explosion.

The northern Afghan region where the blast happened is known for tensions between the mainly ethnic Tajik government leadership and remnants of the militant group Hezb-i-Islami, whose fugitive leader Gulbuddin Hekmatyar, an ethnic Pashtun, is allied to Osama bin Laden and al-Qaida but has denied organizational links.

Kamin Khan, a police official, said people "everywhere" were dead and wounded, including police, children, lawmakers and officials from the Department of Agriculture.

Among the lawmakers killed was Sayed Mustafa Kazimi, a former Afghan commerce minister and a powerful member of the Northern Alliance, said the lawmaker's secretary, Ahmadi, who gave only one name. Kazimi also served as the spokesman of the largest opposition group in Afghanistan, the National Front.

Interior Ministry spokesman Zemeri Bashary confirmed the deaths of 28 people. He said the lawmakers were part of parliament's economic commission.

He blamed the attack on the "enemy of Afghanistan, the enemy of the people of Afghanistan," a term commonly used here to refer to Taliban militants but that could also include other terrorist groups like al-Qaida.

This year has been the deadliest in Afghanistan since the fall of the Taliban. More than 5,700 people have been killed in insurgency-related violence, according to an Associated Press count based on figures from Western and Afghan officials.

In the central Afghan province of Day Kundi, 60 Taliban militants on motorbikes and pickup trucks overran a district center, firing on the town from a mountain outlook, pushing out the police and cutting off the town's main road, the provinvial governor said Tuesday. The Kajran district, in Day Kundi province, is the third overrun by militants in the last week.

Day Kundi's governor, Sultan Ali Uruzgani, said he asked the Afghan government and NATO for reinforcements but that the area hasn't received any such support yet. The district borders Helmand and Uruzgan provinces, which have both seen heavy fighting this year.

Associated Press reporters Jason Straziuso and Fisnik Abrashi in Kabul contributed to this report.