Australia and Malaysia's agreement to swap asylum seekers for refugees jeopardized asylum seekers' rights and was part of a racist and inhumane Australian policy, a U.N. human rights official said Wednesday.

Under the arrangement, Malaysia would accept 800 asylum seekers who entered Australia illegally by sea and in return Australia would settle 4,000 registered refugees living in Malaysia.

U.N. High Commissioner for Human Rights Navi Pillay discussed the agreement Wednesday with Prime Minister Julia Gillard at the end of a six-day visit to Australia to examine major human rights issues.

Pillay criticized Australia's treatment of asylum seekers, including the policy of holding them in immigration detention centers for months while their applications for refugee visas are assessed.

This arbitrary policy was partially explained by the backgrounds of asylum seekers who invariably are not white, western or European, said Pillay, a South African lawyer.

She called on Australian lawmakers to "break this ingrained political habit of demonizing asylum seekers.

"There is a racial discriminatory element here which I see as rather inhumane treatment of people judged by their differences in color, religion and so on," Pillay told reporters in Canberra before leaving Australia.

Immigration Minister Chris Bowen told Australian Broadcasting Corp. radio Wednesday that he had "a very productive discussion" with Pillay on Tuesday and remained committed to finalizing details of the pact with Malaysia.

Pillay said Australia should process refugee applications rather than transporting asylum seekers to Malaysia, which has not ratified the U.N. Refugee Convention or Convention Against Torture.

She was not satisfied by Gillard's assurances that Malaysia would provide written assurances that asylum seekers' right would be protected.

"In my view and as international jurisprudence has shown, assurances are not sufficient protection," Pillay said.

Richard Towle, regional representative of the U.N. High Commission for Refugees which would judge the applications of asylum seekers sent to Malaysia, said that the deal had the potential to improve protections for refugees in the Asia-Pacific region.

Australia plans to pay Malaysia to agree to the deal in a bid to deter asylum seekers from using people smugglers to bring them to Australian shores by boat.

Australia has long attracted people from poor, often war-ravaged countries hoping to start a new life, with more than 6,200 asylum seekers arriving by boat last year. Most are from Afghanistan, Sri Lanka, Iran and Iraq, and use Malaysia or Indonesia as a starting point for a dangerous sea journey to Australia.