Malaysian Prime Minister Mahathir Mohamad's Government has faced its first major political scandal, after a video appearing to show a cabinet minister having sex with another man was circulated to journalists and widely shared online.

Key points: A political staffer alleges a leaked video depicts him and a minister in bed together

A political staffer alleges a leaked video depicts him and a minister in bed together Homosexuality remains punishable by up to 20 years prison in Malaysia

Homosexuality remains punishable by up to 20 years prison in Malaysia The party denies knowledge of the video saying it "rejects dirty political games"

Sodomy remains a crime in Malaysia, punishable by up to 20 years in prison under a British colonial-era law.

The leaked video shows a man who looks like a senior figure in the People's Justice Party (PKR) in bed with another man. Also distributed were alleged texts between the two men.

The PKR is part of Dr Mahathir's ruling Pakatan Harapan coalition, which won an historic election last year to topple former leader Najib Razak and end the 60-year rule of the Barisan Nasional coalition.

Political staffer Haziq Aziz released a Malay-language message on Facebook in the early hours of Wednesday, alleging that the video does indeed depict him and the minister.

It was filmed at the Hotel Four Points in the city of Sandakan in May, Mr Haziq said, where PKR politicians were campaigning during a local by-election.

Mr Haziq, who is an aide to the country's deputy primary industries minister, also called upon Malaysia's Anti-Corruption Commission (MACC) to investigate the PKR figure and claimed that "he is not an individual qualified to be a leader".

LGBT Malaysians face significant discrimination from much of the population, which is more than 60 per cent Muslim.

Weaponising scandal for political gain

Dr Mahathir denied knowledge of the explicit video when a journalist asked him about it on Tuesday.

"I do not know anything. I have just heard [from you], I would have to read up on it," The Star newspaper quoted him as saying.

"If you are willing to do a briefing for me, that would be good," he added.

As the media storm grew on Wednesday, PKR politician Saifuddin Nasution Ismail said the party "rejects any form of dirty political games" and was "committed to continuing developing the country".

Dr Mahathir has denied any knowledge of the viral video. ( AP: Annice Lyn )

"Political styles and methods such as this do not bring any benefit to society," a statement from Mr Saifuddin posted to Facebook said.

"Malaysia has shown a rich tradition of such allegations being weaponised in politics, usually supported by visual props like images and videos," Dr Amrita Malhi, an expert on Malaysian politics and a visiting fellow at the Australian National University College of Asia and the Pacific, told the ABC.

"They are usually aimed at widening divisions and causing splits, allowing competitors to gain the upper hand in political contests," she said.

"They tend to take on a moral tone, with the aim of discrediting the person being targeted."

Anwar Ibrahim — the head of the PKR and the man tipped to take over the prime ministership from Dr Mahathir — was famously jailed for a total of 11 years over what are widely thought to have been politically motivated charges of sodomy and corruption.

Mr Ibrahim was only released a year ago after receiving a royal pardon.

"It was never certain how many followers Anwar lost following the sodomy case," Harris Zainul, a Kuala Lumpur-based political analyst, told the ABC.

"It was not just sodomy that brought Anwar down, but [it] was [also] the court cases that proved him guilty.

"How much it'll affect [the implicated minister] depends whether this goes to prosecution and how that eventually ends up decided."

As the scandal was unfolding on Tuesday, disgraced former Malaysian prime minister Najib Razak posted a well-known meme of Michael Jackson eating popcorn, along with two smiling emojis on his official Facebook account.

Anwar Ibrahim, left, was famously jailed over charges of sodomy and corruption. ( Supplied: Najwan Halimi )

In March, Malaysia's Tourism Minister Mohamaddin Ketapi claimed there were "no gays" in the country while attending a tourism fair in Germany.

Disgraced former PM Najib Razak's party UMNO will look to exploit the scandal. ( AFP: Mohd Rasfan )

Two women in the conservative state of Terengganu were publicly caned last year for having lesbian sex.

Dr Mahathir has claimed that LGBT rights are "Western" and thus unsuitable for Malaysia.

Lokman Noor Adam, head of the opposition United Malays National Organisation (UMNO) party's supreme council, on Tuesday said he had reported the video to police in the capital Putrajaya.

"[The scandal] might prove as another distraction for the coalition," Mr Zainul said.

"The long-term consequences of this [might be] that people feel Pakatan Harapan can't govern."