Kabul, Afghanistan (CNN) -- New U.S. commander Gen. David Petraeus arrived in Afghanistan Friday, a day marred by violence in a part of the troubled nation that was relatively peaceful a year ago.
Petraeus arrived at NATO headquarters in Kabul in the evening, the International Security Assistance Force said.
Earlier in the day, Taliban militants in the northern city of Kunduz attacked the compound of a U.S. aid agency subcontractor, killing at least five people and wounding 20 others, government officials said.
On the day of Petraeus' arrival, the brazen attack served as a grim reminder for international forces that they face a difficult challenge in overcoming the Taliban insurgency, which many say has been gaining momentum. A year ago, places like Kunduz were regarded as safe -- but not anymore.
The pre-dawn raid started when a suicide bomber on foot and another in a car detonated at the gate of the compound, said Mohammad Omar, the provincial governor. Following the initial assault, four gunmen stormed the facility, firing machine guns and throwing hand grenades, according to Omar.
Three of the dead were foreigners -- a Filipino, a Briton and a German, Omar said.
State Department spokesman Mark Toner told CNN that two American contractors were among the wounded and had been taken to the Provincial Reconstruction Team hospital in Kunduz province.
The six-and-a-half-hour attack was on an office of Development Alternatives Inc., a humanitarian assistance subcontractor working with the U.S. Agency of International Development. The Taliban said the building was a base for U.S. Special Operations troops, which the U.S. military denied.
DAI said four of the dead worked for its security subcontractor, Edinburgh International, and that several more EI staff were wounded as were two DAI staff members.
In a conflicting report, Taliban spokesman Zabiullah Mujahid said six gunmen had killed nearly all of the 52 foreigners at the compound.
"The attack by insurgents in Kunduz was an attempt to intimidate Afghans and members of the international community trying to improve the lives of all Afghans," said NATO's International Security Assistance Force in a statement.
"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," said Navy Capt. Jane Campbell, an ISAF spokeswoman. "We remain committed to serving alongside our Afghan partners to improve security and development for all Afghans."
CNN's Atia Abawi, Journalist Matiullah Mati and State Department Producer Charley Keyes contributed to this report.