Immigration Act Article 64

When the staff of the National Immigration Agency inspects entry and exit and there are sufficient facts for the staff to believe that the person being inspected meets one of the following circumstances, the staff shall detain him/her in the service unit temporarily and conduct an investigation:1. The passport, other entry documents or exit documents held by the person are obviously invalid, illegally acquired, counterfeited, or tampered, or that belong to another person or are applied for by using a false identity.2. The person refuses to receive an inspection or severely obstruct the inspection procedure.3. The person is believed to conduct an act set forth in Articles 73 or 74.4. The person meets one of the circumstances on the prohibition of entry or exit pursant to this Act.5. The person is detained temporarily upon the notification from a judicial authority or a military authority due to his/her involvement in a case.6. Other circumstances which temporary detention is deemed necessary pursuant to laws.With respect to the temporary detention imposed on the person pursuant to the provisions of the preceding Paragraph, the staff shall cease the detention immediately when the purposes of imposing such detention have been reached or are no longer required. For nationals of the State, the duration of temporary detention shall not exceed two (2) hours; as for aliens, people of the Mainland Area, residents of Hong Kong or Macau, the duration shall not exceed six (6) hours.The competent authority shall enact regulations that govern the enforcement procedure on temporary detention provided under Paragraph 1, and other matters that must be complied with.
中文原文 入出國及移民法第64條
移民署執行職務人員於入出國(境)查驗時,有事實足認當事人有下列情形之一者,得暫時將其留置於勤務處所,進行調查:
一、所持護照或其他入出國(境)證件顯係無效、不法取得、偽造、變造、冒用或持冒用身分申請。
二、拒絕接受查驗或嚴重妨礙查驗秩序。
三、有第七十三條或第七十四條所定行為之虞。
四、符合本法所定得禁止入出國(境)之情形。
五、因案經司法或軍法機關通知留置。
六、其他依法得暫時留置。
依前項規定對當事人實施之暫時留置,應於目的達成或已無必要時,立即停止。
實施暫時留置時間,對國民不得逾二小時,對外國人、大陸地區人民、香港或澳門居民不得逾六小時。
第一項所定暫時留置之實施程序及其他應遵行事項之辦法,由主管機關定之。

English translation for reference only; the Chinese text prevails. Not legal advice.