The bomb was planted on Musharraf's route from an army hospital in Rawalpindi where he has been staying since January to his home on the outskirts of Islamabad and went off at around 2:00 am (2100 GMT Wednesday).
Nobody was injured and there have so far been no claims of responsibility.
"Four kilograms of explosive device planted in a pipeline under a bridge exploded around 20 minutes before the former president was supposed to cross the spot," senior police official Liaqat Niazi said.
The blast occurred at the Faizabad interchange, which lies at the boundary of the two cities, and destroyed a footpath around two metres wide.
Niazi said the former president was then taken home via an alternative route.
Muhammad Naeem, a spokesman for the Islamabad police, confirmed the incident, saying a bomb disposal squad had cordoned off the area after the blast and searched for additional explosives.
"Nobody was injured in the blast," he said, adding Musharraf was the intended target.
Musharraf, who led Pakistan from 1999 to 2008, returned from self-imposed exile in March last year to fight in general elections, but was barred from taking part and has faced a series of legal cases including treason.
The Taliban also vowed to send a squad of suicide bombers to kill him, and security threats have prevented him from appearing at all but two of his treason hearings.
It was the fourth attempt on the ex-general's life, with the first three occurring while he was in office.
- No deal, yet-
On Monday, a special court indicted Musharraf for treason, in what was seen as a milestone for civilian authority in a country long dominated by the army.
The charges relate to Musharraf's 2007 imposition of emergency rule which came as the Supreme Court was due to rule on the validity of his re-election as president.
Treason carries the maximum penalty of death, but some analysts were sceptical whether the government would allow the trial to be seen through to its completion and risk a greater clash with the military.
Musharraf had also sought permission to leave the country to see his ailing mother in the UAE, leading to renewed speculation that a deal, which would allow all sides to save face, was imminent.
But the government on Wednesday refused to end a travel ban preventing Musharraf from leaving the country.
"The interior ministry has sent a written reply to Musharraf refusing to lift travel bans as there are a number of cases against him," an official of the interior ministry told AFP.
Musharraf had been staying at the Armed Forces Institute of Cardiology in the garrison city of Rawalpindi since being taken ill with a heart condition in January.
But he was believed to be keen to return to his comfortable villa in the scenic Bani Gala suburb of Islamabad.
Ahmad Raza Kasuri, a member of his legal team, told reporters that Musharraf had discharged himself.
"He left the AFIC at his own request and was with his son Bilal," he said.
Thursday's attack had echoes of the first major attempt on Musharraf's life in December 2003, when a powerful bomb went off minutes after his highly guarded convoy crossed a bridge in Rawalpindi.
A few days later, he survived another attempt by two suicide bombers which left 16 people dead.
In July 2007, an unknown group fired a 7.62 submachine gun at Musharraf's plane as it took off from a runway in Rawalpindi.