; (B) to take necessary and appropriate retaliatory actions in the event of such an attack; or (C) to forestall the direct and imminent threat of such an attack. (4) Armed attack on the armed forces To the extent necessary— (A) to repel an armed attack against Armed Forces located outside the United States; or (B) to forestall the direct and imminent threat of such an attack. (5) Evacuation of united states citizens To the extent necessary to protect United States citizens or nationals while evacuating them as rapidly as possible from a situation, outside the United States, that directly and imminently threatens their lives or liberty and— (A) the threatened deprivation of life or liberty is contrary to international law or is otherwise illegal; and (B) in a case where the source of the threat is within a foreign country, the threat is supported by the government of that country or the government of that country is unable or unwilling to control the situation. The President shall make every effort to terminate any such threat without using the Armed Forces. Before using the Armed Forces to protect United States citizens or nationals being evacuated from a foreign country in accordance with this paragraph, the President shall, where possible, obtain the consent of the government of that country. (b) Conditions on emergency use of armed forces Any use of the Armed Forces in accordance with paragraph (3), (4), or (5) of subsection (a)— (1) is subject to the requirements of sections 3, 4, and 5