Taliban insurgents blew up a truck outside the British cultural center in Kabul on Friday, then stormed the compound and fought a gun battle for more than eight hours with Afghan security forces trying to dislodge them.

The violence, which came on the anniversary of Afghanistan’s 1919 independence from Britain, left at least eight people dead, in addition to the attackers, officials said. A Special Forces soldier from New Zealand who was shot in the chest was among those killed, along with five policemen and two Afghan guards, and 22 people were injured, including several Afghan policemen, the officials said.

The radical Islamist Taliban movement asserted responsibility for the assault.

Hundreds of Afghan police officers and soldiers, along with British, U.S. and French troops, surrounded the concrete-walled British Council facility as smoke billowed from one of its buildings.

Britain’s Foreign Office later said that all the attackers were killed and that no British nationals were hurt.

“This was a vicious and cowardly attack, but is hasn’t succeeded,” said British Prime Minister David Cameron. “There has been a tragic loss of life of Afghan police and others.”

The attack began with an explosion at 6 a.m. in the Kart-e-Parwan neighborhood of the Afghan capital. A second, smaller blast from a suicide bomber followed soon after, and other insurgents entered the compound. A gas station attendant working across the divided highway from the British Council, where British employees work alongside Nepalese guards known as Gurkhas, said he saw the first Afghan police truck arrive and then saw two of the policemen shot.

Over the next several hours, there were many bursts of gunfire and at least two more explosions as Afghan police commandos attempted to clear the building of insurgents. Afghan officials said those inside were throwing hand grenades.

At least four times, authorities carried out dead or injured people and put them in ambulances. One, a Nepalese guard wearing a British Embassy guard force hat, appeared to have burns on his face.

Two NATO attack helicopters circled low over the compound as white smoke rose from inside, and armored vehicles stretched far down the highway as the standoff dragged on. Shattered glass lay in the street, and the remains of what appeared to be a car bomb lay about 30 feet from the compound.

The Associated Press reported that two Britons and a South African took refuge inside a safe room throughout the ordeal and ultimately survived.

“The good news is that the British nationals that were in the compound made it to the safe room, and they are alive and well in it,” said a U.S. military official who was at the scene advising the Afghan national police. “The Gurkhas put up a good fight, and they were able to push the attack back.”

The U.S. military official said a team of Afghan police commandos worked to clear the building, along with a French bomb team and British soldiers.

The blasts took place along a main highway in Kabul, near the homes of prominent Afghan officials, including Vice President Mohammad Qasim Fahim and former presidential candidate Abdullah Abdullah.

Correspondent Kevin Sieff and special correspondent Javed Hamdard contributed to this report.