KABUL, Afghanistan (AP) Taliban militants attacked the residence of an American charity and a nearby day care center in Kabul on Friday, sparking a three-hour gunbattle that unfolded as foreigners, including women and children, fled the scene, officials said.

The assault, which killed an Afghan girl caught in the crossfire, comes as foreigners have been increasingly targeted in the Afghan capital as part of an overall surge in violence ahead of April 5 elections.

Authorities offered conflicting information as they worked to secure the area, but all agreed the violence started when a suicide bomber blew himself up in front of the gate of a guesthouse being used by the California-based Roots of Peace group. The organization specializes in agricultural development and advises Afghanistan's Agriculture Ministry.

Roots of Peace issued a statement saying the attack started about 6 p.m. and focused on its residence and a nearby day care center in the Kart-e-Char neighborhood, an affluent area in western Kabul located near the parliament.

It said there apparently were casualties at the day care center, and that five attackers and one child have been confirmed killed, although it did provide more details. It said two Afghan security guards and one foreigner also were wounded.

The U.S. Embassy in Kabul said in a tweet that the group was supported by the U.S. Agency for International Development. It condemned the attack "on an organization that only seeks to help Afghans improve their lives and livelihood."

Mohammad Sharif Osmani, the country director for the group, said six staff members, including four foreigners and two Afghans, had been trapped inside. He was reached while in the hospital with an Afghan colleague who was wounded and had to hang up before he could give more details.

About two dozen foreigners, including women and children, fled the area after the attack began Friday evening, Afghan Interior Ministry spokesman Seddiq Seddiqi said. He said another foreign compound was next door and it was unclear how many people had been trapped inside the Roots of Peace house.

Seddiqi said that besides the suicide bomber, four gunmen also had been killed, ending the standoff at about 8 p.m.

Deputy Interior Minister Mohammed Ayub Salangi said an Afghan girl who happened to be nearby was killed during Friday's battle. Seddiqi said an Afghan woman and a driver had died. The discrepancy couldn't immediately be determined.

It was the latest in a series of high-profile attacks targeting places long considered safe havens for Westerners in the country.

Gunmen who evaded tight security last week sneaked into a luxury hotel in Kabul with pistols and ammunition hidden in their shoes, killing nine people, including two Afghan children, who were dining in the restaurant.

A Swedish journalist also was shot to death on the street in a relatively affluent area earlier this month, and a Lebanese restaurant popular with foreigners was attacked by a suicide bomber and gunmen in January.

The Roots of Peace director did not identify the nationalities of the workers inside the building, but Salangi said at least three were believed to be Americans.

Members of the Afghan National Police rapid reaction force, wearing helmets and bulletproof vests, cordoned off the area.

Witnesses say several houses caught on fire, possibly from the car bomb blast.

Mohammed Sadi, a resident in the area, said the force of the explosion rattled buildings several blocks away and broke windows in his house. "Then gunfire started and the police blocked all the roads," he said.

The upscale neighborhood is home to some of the candidates in next month's elections for president and provincial council. It didn't appear that they were the targets, although the Taliban have stepped up their attacks ahead of the April 5 polling

Taliban spokesman Zabihullah Mujahid said insurgents attacked a "guest house of foreigners and a church of foreigners." His claim could not be immediately confirmed.

"Attacks will continue and we will keep on killing foreigners," he said in a statement to the media.