Thousands of Yemenis protested in Sanaa on Sunday against an immunity law protecting outgoing President Ali Abdullah Saleh from prosecution and demanded he be put on trial for offences they say he committed during his 33-year rule.

In the south of the unstable and impoverished country, four al Qaeda-linked militants and one soldier were killed in clashes.

Saleh's immunity from prosecution, part of a deal put together to persuade him to resign, has angered protesters who have accused security forces controlled by Saleh and his aides of killing hundreds of demonstrators in the past year.

Opposition groups not involved in the power transition deal, sponsored by Yemen's wealthier neighbours and backed by the United States, questioned parliament's authority to approve the immunity law.

We are not bound by the immunity law because it deals only with the (mainstream opposition) Joint Meeting Parties and the (ruling) People's Congress Party, not us, said Mani al-Matari, a leader of a committee set up by youths who led nearly a year of protests against Saleh.

We will continue protesting until all of the revolution's goals are achieved... The parliament has no legitimacy and (instead) we are holding on to international law.

The immunity law, passed on Saturday by a parliamentary majority, does not give full protection to Saleh's aides, as an amendment leaves them vulnerable to prosecution for crimes considered terrorist acts.

The law does, however, give them immunity for politically motivated crimes committed while carrying out official duties.

A United Nations envoy welcomed the amendment to the law that limits the immunity of Saleh's aides - though U.N. human rights chief Navi Pillay has said it may violate international law.

I am pleased that immunity law has been modified but it does not go far enough. The scope of the law is still too broad. The UN cannot condone a broad amnesty that covers UN classified crimes against humanity..., Jamal Benomar said on Saturday.

Human Rights Watch was far more critical. This law sends the disgraceful message that there is no consequence for killing those who express dissent, said HRW regional director Sarah Leah Whitson. The Yemeni government should be investigating senior officials linked to serious crimes, not letting them get away with murder.

Protesters were also angered by remarks on Friday by a Middle East diplomat involved in discussions on Saleh's fate, who said Saleh planned to visit the United States for medical treatment and would not leave Yemen permanently.

Yemeni Nobel Peace Prize winner Tawakul Karman told Reuters

Saleh and his inner circle must be barred from returning to power if the country was to have any chance of restoring stability.

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

FIGHTING IN SOUTH

Four militants, including a local al Qaeda leader, and one soldier were killed in fighting in the town of Radda, 170 km (105 miles) southeast of Sanaa, which was taken over by an al Qaeda-linked group a week ago, a tribal official said.

Saeed Khareesan, an al Qaeda leader, was killed last night during clashes with the Thirteenth Brigade on al-Jadaan Road. One soldier was killed and three were injured, he told Reuters.

The clashes took place after talks between tribal leaders and militants broke down over the Islamists' demands that 16 al Qaeda militants be freed and Islamic law be enforced in the town.

Saleh's opponents accuse him of ceding territory to Islamists to bolster his assertion that only he can prevent al Qaeda from growing stronger in Yemen, and of aiming to wreck the handover of power.

(Reporting by Mohammed Ghobari; Writing by Nour Merza; Editing by Tim Pearce)