KABUL, Afghanistan - Two suicide bombers blew up a car packed with explosives at the entrance to a compound housing NATO contractors in western Afghanistan Thursday, opening the way for three gunmen to rush in and hold employees hostage during an hours-long gunbattle, officials said.

Two private security guards working at the compound and all five attackers were killed during the assault at ES-KO, a contractor for Italian troops deployed in Herat province.

One NATO service member, an Afghan policeman and a private security guard were wounded, according to officials with the ministry and U.S.-led coalition said. Thirty-one people were safely evacuated from the site, the coalition said.

There was no immediate claim of responsibility for the attack, which occurred around 9:30 a.m. in Guzara district, south of the provincial capital of Herat.

The coalition dispatched a quick-reaction force that included ground troops and aircraft to the scene, about one kilometre from Camp Arena, headquarters for NATO's Regional Command West.

The assault came just days after the Taliban launched a brazen, two-pronged assault on a compound housing UN and international aid groups offices in southern Afghanistan. Five people were killed in that attack, including three working with the UN's refugee organization.

Thursday's attack began with the suicide car bombing near the entrance of the company, which is located along the main road to the airport, said Noorkhan Nekzad, a spokesman for the provincial police chief. The road is a route often used by NATO and Afghan forces.

The violence comes as the U.S.-led coalition pushes to speed up the transition of security responsibilities to its Afghan counterparts before the end of 2014 when U.S. and NATO forces are to end their combat mission and go home or move into training or support roles.

The transferring of security responsibilities in Herat city began in July, and the incident could raise new questions about Afghan security forces ability to take on the Taliban alone.

While NATO's 10-year war against the Taliban has hit the insurgents hard, they continue to be able to pull off headline-grabbing attacks.