Afghan soldiers at the compound's security gate stopped the attacker, where he detonated his explosives vest, said Ghulam Muhiddin, spokesman for the Helmand provincial governor.
The bomber had been walking toward a vehicle of the private military contractors who provide security for the governor, said Squadron Leader Jason Chalk, a NATO spokesman.
Nine Afghan soldiers and nine civilians were killed, said Rahmatullah Mohammdi, director of the hospital in Lashkar Gah. Seventeen people were wounded, he said.
The governor, Mohammed Daoud Safi, was inside the compound and was not injured in the attack.
Qari Yousaf Ahmadi, who claims to be a spokesman for Taliban affairs in southern Afghanistan, contacted The Associated Press and said the militant group was responsible for the attack. Ahmadi's exact ties to the militants are not known.
Militants have stepped up attacks in southern Afghanistan in recent months, including the use of roadside and suicide bombs. Twenty-one people died in Lashkar Gah in late August when a suicide bomber tried to kill an ex-police chief, and last week militants killed 19 construction workers riding on a bus in neighboring Kandahar province.
The escalating violence has lead to debate among NATO commanders about whether more troops are needed to patrol the restive south and reign in the resurgent Taliban.
While most of the violence occurs in the southern part of the country, along the border with Pakistan, there have also been increasing attacks closer to the capital.