Malaysia's former deputy prime minister, Anwar Ibrahim, has been released from prison, exactly six years after he was fired from the government. He already has served five years in jail.

As his supporters cheered, Malaysia's most prominent prisoner was rolled in his wheelchair out of the court, and taken to a hospital. From there, he went to his father's house in a Kuala Lumpur suburb.

A three-judge panel on Thursday upheld Anwar Ibrahim's appeal against his conviction on sodomy charges.

Two of the judges ruled that the evidence used to convict him of sodomizing his family's former driver could not be relied upon.

The former deputy prime minister has maintained that the charges were politically motivated and stemmed from a clash with his old boss, former Prime Minister Mahathir Mohamad, in 1998. The two disagreed over economic reforms during the height of the Asian financial crisis in the late 1990's.

After the court ruling, Anwar Ibrahim thanked Mr. Mahathir's successor, Abdullah Ahmad Badawi, for not interfering in the judicial process, and said that he bears no malice against Mr. Mahathir.

"Thank God I am at last free and vindicated by a court of law," he said. " But I must take cognizance of the fact that the Prime Minister Abdullah must have allowed some latitude for the judge to act professionally according to the facts and the law."

However, Mr. Mahathir told reporters he sticks by his decision to fire his former protégé.

"As far as I'm concerned, I acted in good faith because I believe that he was guilty," he said. " And in the case of the government, as prime minister I don't have to wait until there is no reasonable doubt, as prime minister I have every right to dismiss anybody even on bare suspicion."

Lim Kit Siang, a leader of the opposition Democratic Action Party, says the decision shows the judiciary's growing independence.

"It should be a great boost and encouragement to all Malaysians that they should not despair in their commitment to ensure that there is justice, freedom and good governance," he said.

Supporters say Anwar Ibrahim will seek overseas treatment as soon as possible for a severe back injury. His family says the injury, which dates back to his arrest in 1998, threatens to cripple.

Others say he also will continue to push for greater transparency and accountability in Malaysia's government.