Afghan security personnel investigate the site of a suicide car bombing and a gunfight near the U.S. consulate in Herat Province, west of Kabul, Afghanistan, Friday, Sept. 13, 2013. Taliban militants attacked the U.S. consulate in western Afghanistan on Friday morning, using a car bomb and guns to battle security forces just outside the compound in the city of Herat (Hoshang Hashimi/AP)

The State Department confirmed the attack, saying that no Americans were slain but that an unknown number of Afghan police were likely wounded.

The Taliban claimed responsibility for the attack, the second major one targeting key U.S. facility in Afghanistan since the efforts for starting peace talks with the insurgents failed in Qatar back in June. The previous attack included the main CIA station near the presidential palace in Kabul where some local guards of the station were killed.

In Friday’s attack, the Afghan police were guarding the heavily protected compound when a strong blast caused by a car bomb ripped through its main entrance, residents and an Afghan army official said. The explosion killed several police, residents said. The State Department described the blast as coming from a truck bomb .

The explosion allowed a group of assailants, including suicide bombers, to enter the perimeter of the compound, said Gen. Taj Mohammad, a senior Afghan army commander for the region. State Department spokeswoman Marie Harf said in a statement that American security personnel and contract guards reacted to the attack, while American non-security personnel took shelter.

The initial explosion was strong enough that windows shattered in houses several hundred feet from the consulate.

The consulate, a multi-storied building also suffered some damages, local media reported. Various other blasts were heard, as well as an intense exchange of gun fire, residents said.

A jet fighter was seen flying over the consulate, located at the foot of a hill far from residential areas of the city. Armored personnel carriers belonging to either NATO or the U.S. military were seen rushing toward the multistory compound, residents said. By about 8 a.m., more than two hours after the bombing, the U.S. Embassy in Kabul said the situation at the consulate was under control.

Residents later saw two helicopter gunships flying above the consulate and one other chopper landing inside the complex, apparently to evacuate the staff.

Afghan deputy interior minister Ayoub Salangi said all of the seven attackers were killed either in the exchange of fire or as a result of blasts caused by explosives they were wearing.

More than 20 people, including police, were hurt, he said. Also on Friday, the Taliban launched another suicide attack on a government building in Paktika province near the border with Pakistan, officials said. There were no immediate details of that strike, but local media said that more than a dozen people, mostly security forces , were wounded in it.

Harf, the spokeswoman, said that “it appears American and contract security personnel addressed any attackers who managed to enter the compound.” Some of them were apparently wearing suicide explosive devices, she said in the statement.

One contract security member may have been wounded in the fighting, she said. Friday is part of the weekend in Afghanistan, so the consulate was not busy.

Herat, lying near Afghanistan’s borders with Iran and Turkmenistan, is generally considered among the few relatively secure parts of the country. U.S. troops have been fighting the Taliban and training Afghan military forces for over a decade. Most U.S. troops are expected to pull out of the country in 2014.