The Taliban claimed responsibility for the attack, which began about 3:30 a.m. when a suicide car bomber detonated a sports utility vehicle at the compound's entrance. An Afghan security guard was killed in the blast, said Gen. Abdul Razaq Yaqoubi, chief of police in Kunduz province.
Five other attackers then stormed a building used by Development Alternatives Inc., a Washington, D.C.-based global consulting company that has a USAID contract to work on governance and community development in the area.
An Afghan policeman and two foreign workers - one from Germany and the other from the Philippines - were killed in the fighting, said Gen. Murad Ali Murad, a commander for the Afghan National Army.
The bodies of five suicide attackers were recovered from two floors of the building.
In Berlin, a spokesman for Germany's Foreign Ministry confirmed a German citizen had been killed in the Kunduz attack but did not elaborate. He was speaking on condition of anonymity in line with government policy.
Taliban spokesman Zabiullah Mujahid told The Associated Press that six suicide bombers attacked a "training center" for Afghan security forces in Kunduz and killed 55 foreigners. The Taliban often exaggerate their claims.
The attack appeared part of a Taliban campaign against development projects at a time when the U.S. and its allies are trying to bolster civilian programs to shore up the Afghan government. On Wednesday, militants rocketed a base for South Korean construction workers in Parwan province but caused no casualties.
In April, a gunman killed an 18-year-old woman working for Development Alternatives, based in Washington, D.C., as she left her job in the southern city of Kandahar. Police believed the killing was part of a Taliban campaign against Afghans working for foreign development organizations.
"This attack shows the insurgents' desire to prevent progress, and draws attention to their true goal of serving themselves rather than the people of Afghanistan," Navy Capt. Jane Campbell, a spokesman for NATO, said, referring to the Kunduz attack.
Coalition troops provided assistance to Afghan security forces and helped wounded civilians at a nearby NATO base, she said.
Violence is rising in Afghanistan, and concern is growing in Washington and other allied capitals over the direction of the war. The 120,000-member NATO-led force is awaiting the arrival of a new commander, Gen. David Petraeus, who has warned of hard fighting this summer.
At confirmation hearings that Petraeus breezed through earlier this week, he told U.S. Senators he, designed to limit civilian casualties and improve support for the foreign forces fighting the Taliban-led insurgency. Some troops and congressional Republicans complain they handicap U.S. forces.
The United Nations is relocating a few dozen of its 300 foreign-hired staff because of fears about rising violence.
Last October, three gunmen with automatic weapons and suicide vests stormed a guest house used by U.N. staff in Kabul, killing at least 11 people including five U.N. workers.