The militant, driving a car packed with explosives, attempted to break through the gates of the base.
"The terrorist was killed when he was fired upon," the source said.
Sources in the Afghan Interior Ministry said some 20 people were wounded in the explosion, all of whom were civilians. No casualties among the international troops have been reported.
On Tuesday, six people were killed and 28 injured when Taliban militants attacked two government buildings in the same city. The government said the attacks were carried out by seven militants, including five suicide bombers, although Al Jazeera reported that about 30 fighters had taken part.
The Arabic news channel quoted a Taliban spokesman as saying the fighters were targeting government buildings, police stations and checkpoints across the city.