Australia has demanded an explanation from Malaysia for why it turned away an Australian senator from his fact-finding mission to investigate the Southeast Asian country's electoral system ahead of elections due within months, the prime minister has said.

Nick Xenophon, an independent South Australia state senator, returned from Malaysia on Sunday saying he had been deported on the orders of the "highest levels'' of the Malaysian government for his support of democracy reformers.

He told reporters on arrival at Melbourne International Airport after an 8-hour flight that he had become the first Australian lawmaker ever to be deported from any country when he was turned away by on authorities on arrival at Kuala Lumpur on Saturday.

Prime Minister Julia Gillard revealed that her government made "immediate and strenuous representations" for Xenophon to be allowed to stay in Malaysia.

"I was surprised and disappointed to see the treatment of Senator Xenophon yesterday," Gillard told reporters.

"Clearly we didn't succeed in getting the agreement of the Malaysian government for him to remain in Malaysia. We will continue to pursue this issue with the Malaysian government," she added.

'Highest levels'

Xenophon blamed his support for the Malaysian democracy reform group Coalition for Clean and Fair Elections, known as Bersih, for the shock decision to turn him away.

"I understand the decision to deport me came from the highest levels of the Malaysian government," Xenophon said.

"I was told I was being deported under a certain section of the Immigration Act which basically relates to being a security risk, but it seems the only risk I am is to embarrassing the Malaysia government because of my advocacy for clean elections in Malaysia," he added.

Xenophon said it was up to Malaysian Prime Minister Najib Razak to say whether he had ordered the deportation.

Xenophon had planned to meet with Malaysian opposition leader Anwar Ibrahim, a Cabinet minister, electoral officials and political activists to discuss transparency issues for national elections that must be held by the end of June.

'Security reasons'

Hisan Hamzah, the police chief of Malaysia's central Selangor state, said Xenophon was taken into custody when he arrived at the airport early Saturday and denied entry "for security reasons." Xenophon was detained in an interrogation area of the airport until he was put on a plane to Melbourne on Saturday night.

Immigration Director Gen Alias Ahmad said in a government-issued statement that Xenophon was barred because he was at a banned Kuala Lumpur demonstration last year. The rally was organised by Bersih.

"Malaysia is a free and democratic country, but no one is above the law," the statement said. "Authorities will take the appropriate action against any individual deemed to have violated national laws."

Xenophon, a former lawyer, said he was considering appealing his deportation order in the Malaysian courts. He would have to testify in such a court case via a video link because he was banned from entering Malaysia indefinitely.

Xenophon said the visit planned by him and three parliamentary colleagues was intended to be low-key event which would have attracted little media attention had it gone ahead.

"You need to ask the question: what does the Malaysian government have to fear by having an open and robust scrutiny of their electoral processes?" he said.

"If the Malaysian government thought that they were doing the smart thing, I think it's spectacularly backfired on them," he added.