Updated

Pakistan's military ruler won a vote of confidence from both houses of parliament and the country's four provincial assemblies on Thursday in a carefully orchestrated process that empowers him to finish out his five-year term as president.

The opposition walked out in protest and denounced the proceedings as a sham.

The balloting on President Gen. Pervez Musharraf (search)'s future follows a surprise deal with a coalition of hardline Islamic parties that agreed to support his claim to the presidency in return for a promise that he step down as army chief by the end of 2004.

Musharraf, who took power in a 1999 coup, has held both positions since winning a controversial presidential referendum in 2002 in which he was the only candidate. His term expires in 2007.

The Senate on Thursday voted 56-1 and the lower house voted 191-0 to give Musharraf the vote of confidence he sought, but scores of opposition lawmakers staged a walkout in protest. The assemblies of the North West Frontier Province (search), Baluchistan (search) and Sindh (search) all voted unanimously in favor of Musharraf, with large numbers of opposition legislators abstaining or walking out.

In the NWFP, for instance, Musharraf won by a vote of 30-0, with the rest of the members in the 124-seat assembly refusing to take part. Voting in Punjab (search) was ongoing, but Musharraf was assured of victory as he only needed a majority of the cumulative votes in all four provincial assemblies.