He said two suicide bombers had blown themselves up outside the compound.
The interior ministry said the fighters had also targeted civilian buildings in Zaranj, the provincial capital.
"A group of terrorists attacked some civilian and government buildings this morning in Zaranj," Zemarai Bashary, an interior ministry spokesman, said.
"The police response was very quick and strong.
"They entered the governor's office first, but police killed all those attackers instantly."
The Taliban has claimed responsibility for the attack, saying it was aimed at government officials.
"Seven bombers and two gunmen are involved in the attack. Two of the bombers have set off their explosives and the others are locked in a gunbattle," Qari Yousuf Ahmadi, a Taliban spokesman, said, before police announced the fighting had ended.
The Taliban has launched a series of attacks in the south of the country in recent weeks, ahead of a planned military offensive in nearby Kandahar province.
US forces have gathered on the outskirts of Kandahar city ahead of the Nato operation, which is to be the largest military offensive so far against the Taliban.
The US build-up around Kandahar is a key part of the additional deployment of 30,000 troops ordered by Barack Obama, the US president, in an effort to turn the tide in the Afghan war, now into its ninth year.
By August there will be around 100,000 US troops deployed in Afghanistan, more than three times as many as when Obama took power.