The suicide bombing and gunfire assault in the Parwan provincial capital, Charikar, took place just after 11 a.m., interrupting a meeting of local police and intelligence heads, as well as international advisors including U.S. military officials.
Charikar is about 30 miles north of Kabul, and Parwan province is home to Bagram Airfield, a base for U.S. and NATO troops, the AP says.
The governor of Parwan province, Abdul Basir Salangi, told media that up to six suicide bombers had stormed the compound in an attack that lasted at least an hour, the BBC reports.
A suicide car bomb was detonated, after which militants broke into the compound.
In addition to the 22 people killed in the attack, at least 35 were wounded, some of them seriously. The governor was unharmed as were the visiting U.S. military officials.
While Parwan is considered a relatively peaceful region of Afghanistan. security at the governor’s compound had been reinforced after a recent attempt to kill Salangi.
Salangi is a prominent anti-Soviet and anti-Taliban resistance commander, and an ally of President Hamid Karzai, Agence France-Presse says.
The Taliban has claimed responsibility for the attack on the governor's compound.
Zabihullah Mujahed, a Taliban spokesman, told AFP that the attack was carried out "by our suicide and devout fighters.”
President Karzai condemned the attack in a statement released a few hours after the incident.