Former deputy prime minister Anwar Ibrahim today filed an appeal one day after a court rejected his defamation suit against his former boss Dr Mahathir Mohamad.

High Court judge Tengku Maimon Tuan Mat yesterday allowed the application by Mahathir to strike out the lawsuit and also awarded the former prime minister costs.

"The appeal was filed ... at the Kuala Lumpur High Court, to the Court of Appeal, against the entire decision because there is the element of cost," Anwar's lawyer, Sankara Nair said.

Tengku Maimon threw out the suit, saying in her judgment that Anwar's action is "unsustainable based on background evidence."

Anwar, who was not in court issued a statement later, saying the judge's decision was "a gross injustice" and "utterly devoid of any legal merit."

Anwar lodged the defamation suit in January last year after Mahathir said he could not allow his former deputy to become prime minister because he was a homosexual.

Dr M's 48-page affidavit

Mahathir responded with an application to strike out the suit, filing a 48-page affidavit in which he accused Anwar of aspiring to become prime minister and using the suit to "rehabilitate himself for high office."

Anwar was heir apparent to Mahathir until his sacking in 1998 after sodomy and corruption charges that landed him in jail for six years.

The sodomy conviction was later overturned but the corruption verdict stands, barring Anwar from standing for public office until April 2008.

"I cannot have a person who is like that in my cabinet who may succeed and become the prime minister. Imagine having a gay prime minister. Nobody would be safe," Mahathir told reporters in September 2005.

The lawsuit said Mahathir's "falsely and maliciously" made comments were widely reported by the media, causing "irreparable damage" to Anwar's reputation.

Human rights groups have said allegations that Anwar had a sexual relationship with his male driver, then abused his power to conceal it, were trumped up to prevent him from challenging Mahathir during his 22-year rule.