In a unanimous verdict, a three-judge panel said Wednesday there were insufficient grounds to overturn Anwar's 1999 conviction for trying to influence a police investigation into alleged sodomy.

Anwar's lawyer, Karpal Singh, accepted the court's decision, but said he would advise his client to seek a royal pardon, the final option for overturning the conviction.

"Well, this is the final, and we have to accept it," he said. "I would appeal to the King perhaps to invoke his powers of executive clemency under the constitution, and I hope that would be done as soon as possible."

Anwar, in Germany recovering from back surgery, was quoted by the Reuters news agency as saying he was undecided whether or not to seek a royal pardon.

Malaysian law prohibits convicted felons from holding posts in political parties or running for public office for five years after the end of a prison sentence.

Anwar, who was sacked from the government by former Prime Minister Mahathir Mohamad, was convicted in 1999 on charges of corruption and sodomy. He was given a six-year jail term for the corruption conviction, which was later shortened to four years and expired last year.

He was serving a subsequent nine-year sentence for sodomy, when on September 2, the same court that ruled Wednesday overturned the sodomy conviction and set Mr. Anwar free.

Many Malaysians saw his release as a sign that the new prime minister, Abdullah Ahmad Badawi, was allowing the judiciary a greater degree of freedom than it was thought to have enjoyed under Mr. Mahathir's rule.

However, Mr. Abdullah said earlier this week that Anwar would not be allowed to return to the ruling United Malays National Organization, or UMNO.

Many see membership in UMNO as crucial to anyone hoping to become Malaysia's prime minister, and some observers say Anwar's inability to hold party or public office curbs his political clout.

But analysts such as political activist Tian Chua say he can still command significant influence from the outside.

"It is not important whether the government gives him a pardon or not," he said. "There's a lot of political prisoners who have been very effective without formal political posts."

Anwar's firing and subsequent arrest in 1998 triggered massive protests, and he still retains considerable political and public support.