Philippine President Rodrigo Duterte says he ordered the investigation into a 71-year-old Australian nun for “disorderly conduct”, justifying it as a legal move against “undesirable” foreigners.

Sister Patricia Fox, a co-ordinator of a Philippine congregation of Catholic nuns called Notre Dame de Sion, was taken from her house this week and detained at the immigration bureau in Manila for almost 24 hours.

She was released on Tuesday pending further investigation.

Fox had taken part in rallies seeking the release of political prisoners and urging Philippine authorities to respect human rights.

“I ordered her to be investigated, not deported at once, not arrested, but to invite her to an investigation for a disorderly conduct,” Mr Duterte said during the change of command ceremony of the Armed Forces of the Philippines.

Mr Duterte said he would be insulted by religious personalities and foreigners. “It’s a violation of sovereignty,” he said, accusing Sister Fox of badmouthing his administration. “You do not have that right to criticise us. Do not insult my country.

“We never did that to Australia. We never did that to a European country. Why don’t you criticise your own government, the way you handle the refugees, hungry and dying and you turn them back to the open sea,” he said.

The United Nations has called on Australia to take responsibility for around 800 refugees and asylum seekers stranded in a detention centre on Papua New Guinea where it said many lack medical and mental health care.