Taliban gunmen crept up to an Afghan government office under cover of darkness early Wednesday and launched a battle that left three Afghan soldiers and four attackers dead, police said.

The attack came after an explosion earlier in the week killed a motorcyclist in what an Afghan commander suggested was a botched suicide attack, and U.S. troops skirmished with insurgents near the Pakistani border.

Insurgents who include members of the Taliban, the Islamic militia that ruled most of Afghanistan until the U.S.-led invasion in 2001, are trying to derail the country's presidential election, set for Oct. 9.

The mayor's office in Khaki Afghan, a district of southeastern Zabol province, was targeted Wednesday by rebels with machine guns and rifles, said Jailani Khan, the deputy police chief.

In four hours of fighting, four Taliban fighters were killed and two were captured with their weapons, Khan said. In addition to the three Afghan soldiers killed, two were wounded.

The motorcyclist was killed Tuesday in Khost province that also injured a farmer on a passing tractor, Gen. Fazel Mohammed Sahel said.

"He came across the fields and drove onto the main road near the police checkpoint," Sahel said. "There was a military vehicle driving toward him, and suddenly he blew up."

Sahel said that the man appeared to be a suicide bomber but that he had no idea what kind of mission the motorcyclist might have been on.

The U.S. military said suspected Taliban fighters shot at one of its patrols on Monday near Shkin, a border town in Paktika province. The patrol returned fire, but the attackers apparently slipped away.

[Two rockets slammed into a NATO military camp in northern Afghanistan, wounding four soldiers, officials said Thursday. The 107mm rockets hit the base in Kunduz city Wednesday evening.]