(1) An immigration officer may cause any immigrant (not being an immigrant concerning whom an immigration officer has decided that he or she is not a prohibited immigrant), unless a permit has been granted to him or her under this Act, to be arrested and brought before a District Court, and the Magistrate shall, if satisfied that this section applies to the immigrant, order that he or she be detained in custody under this Act, and if not so satisfied he or she shall order his or her release.