The blast, 50 metres (yards) from the base, was heard several miles away and damaged several shops, homes and a school, Akbar Zadran, the chief of Sabari district, told Reuters.
Four gunmen attacked the base but were killed after an hour-long gun battle, Zadran said.
There was no immediate claim of responsibility.
The attack follows an assault on a military air base in Khost province last week, and comes just ahead of the normal start of the spring fighting season, when Taliban Islamist insurgents and the Afghan army step up operations.
The Afghan government controls less than 60 percent of the country after territorial gains by the insurgents since NATO-led forces ended their combat operations at the end of 2014.
US and Afghan officials have warned about increased fighting this year as the Taliban look to widen their influence.
The Taliban are seeking to expel foreign troops, defeat the US-backed government and reimpose Islamic law after their 2001 ouster.
The head of US Central Command, General Joseph Votel, this month asked for more American troops to join the roughly 8,400 already stationed in Afghanistan to break the stalemate.
(Reporting by Ahmad Shah, Writing by Tommy Wilkes and Editing by Nick Macfie)
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)