Putrajaya:  Australian Prime Minister Kevin Rudd on Thursday praised Malaysia's revitalised democracy  as the two countries celebrated their warming ties by announcing a plan to jointly train teachers from Afghanistan.

Rudd, on his first visit to Malaysia since taking office, said Malaysia's democracy was "tested and applied" in March 8 elections in which the opposition made unprecedented gains, loosening the ruling coalition's 51-year-long hold on power.

"Democracy is not just alive and well in Malaysia but flourishing," Rudd told reporters at a joint news conference with his counterpart, Abdullah Ahmad Badawi.

Uneasy relationship

Malaysia has had an uneasy relationship with Australia, evident in the frequent verbal sniping between their previous prime ministers - Malaysia's Mahathir Mohamad and Australia's Paul Keating and John Howard.

Ties have improved since 2003 when Abdullah replaced Mahathir, who was incensed when Keating once called him "recalcitrant". Howard also frequently criticised Malaysia's human rights record. Rudd, a former diplomat with expertise in Asia, has maintained a much softer line.

As part of their improving ties, the two prime ministers announced that Afghan teachers will be trained in Malaysia with the help of the Australian government and universities.

Rudd, who was making a one-day stop in Malaysia on his way home from Japan, said part of the reason the agreement was forged is that Malaysia is a Muslim country that "can comfortably partner with the education needs of Afghanistan".

"This points to a new phase in the relationship between Australia and Malaysia," he said.