Yemen's parliament approved a law on Saturday granting outgoing President Ali Abdullah Saleh immunity from prosecution over the killing of protesters, in a bid to push ahead with a plan to ease him out of power and end nearly a year of unrest.

Backed by a majority of voting members, the law stops short of giving full immunity to Saleh's aides.

Parliament also supported the candidacy of Vice President Abd-Rabbu Mansour Hadi in a presidential election next month to replace Saleh following his 33-year rule.

The law had previously offered blanket immunity to Saleh's associates, but an amended version limited that to protection from prosecution over politically motivated crimes committed while conducting official duties, except those considered terrorist acts.

The immunity, part of the plan hammered out by Yemen's wealthier Persian Gulf neighbors, would cover Saleh's entire presidency and could not be cancelled or appealed against.

Neighboring top oil exporter Saudi Arabia and the United States had backed the autocratic Saleh for much of his time in power, but endorsed the transition deal, fearing continued unrest would be exploited by al-Qaida's Yemen-based regional wing, seen by Washington as the network's most dangerous branch.

(Reporting by Mohammed Ghobari; Writing by Firouz Sedarat; Editing by Sophie Hares)