The death toll in a powerful suicide truck bombing that struck a guest house in eastern Afghanistan has risen to 21, with as many as 90 other people injured, officials said.

No-one immediately claimed responsibility for the late Friday night bombing in Pul-e-Alam, the capital of Logar province.

There was no indication why the guest house was targeted. In Afghanistan, guest houses are lodgings often provided for free by the government, usually for the poor, travellers and students.

Afghanistan emergency services
At least 21 people have died (AP)

The interior ministry quickly blamed the Taliban, although there was no initial claim of responsibility by the group.

The attack came on the eve of the official date set for the start of the final withdrawal of US and Nato troops from Afghanistan.

The Taliban, who had demanded that all US troops pull out of Afghanistan by May 1, have not offered any guarantees for the safety of the departing troops.

There was no indication the bombing was connected to the pullout and there are no US or Nato troops in Logar province.

An injured man
An injured man is taken to hospital (AP)

Hasib Stanikzai, head of the Logar provincial council, said that at the time of the attack, a group of local police were staying at the guest house, waiting for transportation home.

Other rooms were occupied by students from more remote districts who had come to the provincial capital for university entrance exams.

Interior ministry spokesman Tariq Arian said the attack was under investigation and that the roof of the guesthouse had collapsed in the bombing.

There were fears bodies could be trapped beneath the rubble, he said.