Authorities have defused four small bombs planted near the house of former Pakistan president and army chief Pervez Musharraf, just two days before he is to appear in court in a treason case.

An onlooker spotted the devices alongside a road about half a kilometre from Mr Musharraf's farmhouse on the outskirts of Islamabad, a police official said.

The improvised devices were left in separate plastic shopping bags and there were about three kilograms of explosives altogether, he added.

Authorities do not know if Mr Musharraf was the intended target, the official said.

Mr Musharraf is accused of high treason and is scheduled to appear before a courttomorrow. He was not able to attend a previous court hearing on December 24 because of a bomb scare.

Mr Musharraf ruled Pakistan for nearly a decade after taking power in a 1999 coup. But he was forced to step down in 2008 and later left the country in self-imposed exile. He returned in March hoping to take part in the upcoming elections but immediately faced a barrage of legal problems, relating to his time in office.

The high treason case relates to the state of emergency he imposed in 2007.

Mr Musharraf's supporters have portrayed the charges against him as a vendetta, and his lawyers are challenging the impartiality of the three judges hearing the case and the appointment of the prosecutor representing the government.