Australia holds refugees and asylum seekers arriving by boat on PNG’s Manus Island and the Pacific nation of Nauru.
Canberra plans to shut the Manus centre by 31 October, but uncertainty remains over where its 900 detainees will go.
The UNHCR said it was “profoundly troubled” by the “mounting risks” associated with Australia’s withdrawal.
“Having created the present crisis, to now abandon the same acutely vulnerable human beings would be unconscionable,” said Thomas Albrecht, the UNHCR’s regional representative.
“Legally and morally, Australia cannot walk away from all those it has forcibly transferred to Papua New Guinea and Nauru.”
Australia has not responded the UNHCR’s statement, but it has consistently argued its offshore detention policy is humane because it reduces deaths at sea.
Up to 1,250 of the 2,100 people currently detained in PNG and Nauru may be resettled in the US under a political deal. However, the US is not obliged to accept that number.
The UNHCR has ruled more than 1,200 are genuine refugees, while a further 500 are awaiting a determination.
The Australian government has set up alternative accommodation on Manus Island, but refugees and advocates have expressed fears about whether the transit centres are safe.
On Wednesday, the agency criticised Australia and PNG for not taking enough steps to provide essential services for asylum seekers and refugees who may remain in PNG.
It said overstretched medical facilities and the ending of torture and trauma services would add to the “extraordinary human toll” many had suffered under prolonged detention.
The agency said Australia should provide ongoing care and long-term solutions.
Last week, Australia said some refugees may have the option of detention in Nauru, if accepted by that nation. The government has also suggested that non-refugees could be deported from PNG.