A bomb exploded near a convoy carrying the former president, Pervez Musharraf, in the capital of Islamabad but the former ruler was not harmed, say police.

A police official, Mohammad Hayat, said the device exploded as the general was being moved late on Wednesday night from the military hospital in Rawalpindi, where he had been staying, to his home in Islamabad.

Hayat said Musharraf's convoy had just crossed a bridge entering the capital when the bomb went off.

Musharraf's spokeswoman, Aasia Ishaq, said he was fine and had reached his home safely. There was no immediate claim of responsibility for the attack.

Musharraf survived multiple assassination attempts while he was in office. When he returned to the country last year the Pakistani Taliban vowed to kill him.

Earlier this week, the general was charged with treason over alleged constitutional violations during his reign.