A policeman guarding the office and his supervisor, who had stopped there during a routine security patrol, were wounded in the blast late on Thursday in the capital of Khost province, said Mohammed Ayub, the province's police chief.
The men suffered minor injuries.
No one has claimed responsibility for the attack, but on Friday Ayub blamed "enemies of the election," an indirect reference to Taliban fighters ousted from power in late 2001.
"The entire country of Afghanistan knows who these enemies are. They are trying to sabotage security before the elections," he said.
Afghanistan is scheduled to hold parliamentary elections in September.
The authorities have expressed concern over a steady stream of Taliban attacks against the government, saying they could threaten the vote, seen as a key step towards stability.
The attack comes amid an unprecedented spate of bloodshed that has left more than 700 people dead in three months and threatened to unhinge three years of progress towards peace in Afghanistan.
US and Afghan officials have warned that the violence is likely to worsen in the lead-up to the elections.
Suspected Taliban fighters have been particularly active in Khost, near the Pakistan border, in recent months.