Smoke rises from an Afghan government building after Taliban insurgents stormed the compound in a fatal attack. (REUTERS)

Not long after dawn broke Sunday in this southeastern city, four men dressed as Afghan police drove up to a downtown checkpoint. In the back seat of their white Toyota Corolla were 300 pounds of homemade explosives, wired to a trigger on the driver’s side. Two of the passengers wore suicide vests.

Ten hours later, after an intense day of close-quarters gun battles inside government offices and a suicide blast, three Afghan police officers and two Afghan soldiers were dead, two U.S. soldiers were wounded, and three of the four attackers had been killed. The fighting was the latest attempt by insurgents to target government forces in the heart of major Afghan cities.

Despite the losses, U.S. soldiers who took part in the fighting praised Afghan police for responding quickly, trapping the insurgents inside a government building and preventing more casualties.

“We paid a price today, but I’m very happy,” said Lt. Col. Jesse Pearson, commander of the U.S. battalion that responded to the scene. “We totally spoiled their attack.”

On Monday, the insurgents struck two more times, elsewhere in the country. Four soldiers from the NATO coalition were killed when an improvised explosive device was triggered in eastern Afghanistan, officials said, and four Afghan civilians were killed in a suicide blast in eastern Laghman province.

But the death toll remained far lower than they would have been had the explosive-packed Corolla in Khost detonated successfully. The vehicle approached a border checkpoint about 5 a.m. Sunday. Border police officers, sensing trouble, opened fire on the car.

The insurgents jumped out and fired back, then ran into the nearby headquarters of the Khost city traffic police, killing three policemen at the gate as they entered, officials said.

At nearby Forward Operating Base Salerno, Pearson, who had planned to spend the day visiting his outposts in the province, ordered his troops to the scene. The U.S. soldiers from a military police company who arrived first fired a powerful .50-caliber machine gun from the truck and killed an insurgent who stood about 15 meters away, Pearson said.

By the time Pearson arrived, about 9 a.m., U.S. troops were focused on defusing the car bomb and did not realize that three insurgents remained in the building. As U.S. and Afghan troops began searching the traffic-police headquarters, the insurgents opened fire, he said, prompting a close-range gun battle that stretched over the next four hours.

During the shootout — “back and forth, room to room,” Pearson said — two Afghan soldiers were killed. One of the suicide bombers detonated his vest. An American soldier was injured in the blast but not seriously; another American soldier was shot but was in stable condition, he said.

As troops searched the building, which billowed smoke and fire, one of the attackers was shot and killed and the fourth was arrested unharmed.

“We’ll be spending a lot of time with him,” Pearson said.

Sunday’s attack bore the hallmark of recent insurgent plots, including the use of Afghan security force uniforms as a disguise to target Afghan government bases and troops.

Although the Taliban claimed responsibility, the attack was likely the work of the Haqqani network, a Pakistan-based affiliate of the Taliban that has been fighting to regain control of Khost and its surrounding provinces, officials said. The group’s leadership operates out of the Pakistani town of Miramshah, across the border from Khost, in the tribal border region of North Waziristan.

U.S. military officials here said the Haqqani network’s leadership, including brothers Siraj and Badruddin Haqqani, have been urging fighters to keep the pressure up this spring and summer. They asked their foot soldiers not to return to Pakistan this past winter, a time insurgents typically rest for the next fighting season.

The increased U.S. military presence in Khost has taken a toll on the insurgents; hundreds have been killed and captured over the past several months. While the Haqqani network’s ground commanders are under growing pressure, their fighters are capable of launching high-profile attacks here and in Kabul.

Sunday’s attack came a day after a Taliban suicide bomber blew himself up among a group of student doctors at the main military hospital in Kabul, in a highly secure section of the capital, killing at least six and wounding more than 30.

Separately, two Afghan police were wounded after an explosive device attached to a motorcycle went off in an area of southern Kandahar on Sunday, a witness there said.

Salahuddin is a special correspondent. Special correspondent Javed Hamdard in Kabul contributed to this report.