A half dozen Taliban fighters infiltrated a provincial capital just south of the Afghan capital on Monday and fired rocket-propelled grenades at government buildings, officials said. Two police and three attackers died in the violence.

The militants fired four RPGs at the governor's compound and two at the police chief's office in the city of Pul-i-Alam, the capital of Logar province, about 40 miles (60 kilometers) south of Kabul, said Din Mohammad Darwesh, the governor's spokesman.

The militants took up positions in a building behind the governor's house and were surrounded by Afghan soldiers and police, he said.

After the rockets were fired, a gunbattle broke out between Afghan forces and the militants, said Mustafa Musseini, the provincial police chief. Two Afghan police officers were killed, he said.

U.S. helicopters patrolled the skies, and one fired a rocket at an attacker, killing him, Musseini said. Another attacker blew up a suicide vest and killed himself, and a third attacker died in battle, Musseini said.

A Taliban spokesman, Zabiullah Mujahid, said six militant suicide bombers had entered Pul-i-Alam.

Taliban militants have launched several multi-pronged attacks on eastern Afghan cities in recent months. The militants typically attack multiple sites at once with rockets, gunfire and suicide explosions.

Violence has spiked the last three years, and a record number of U.S. and NATO troops are now in the country. Afghan and international troops are trying to increase security ahead of the country's Aug. 20 presidential election.

Elsewhere in the country, six Taliban militants died after a roadside bomb they were planting exploded prematurely.

The militants were planting the bomb around 3 a.m. Monday in the Naw Bahar district of Zabul when the bomb exploded, said Abdul Zarif, an Afghan official in Zabul province.

Militants have greatly increased their use of roadside bombs in Afghanistan this year. A record number of U.S. and NATO troops were killed in the country in July, many of them from roadside bombs.