; or (ii) a crime that endangers the national security of the United States for which the noncitizen has served a term of imprisonment of at least 5 years; and (B) is not inadmissible to, or deportable from, the United States due to such a conviction. (2) Waiver The Secretary may waive paragraph (1) for humanitarian purposes, to assure family unity, due to exceptional service in the United States Armed Forces, or if such waiver otherwise is in the public interest. 4. Protecting veterans and service members from removal Notwithstanding any other provision of law, including section 237 of the Immigration and Nationality Act ( 8 U.S.C. 1227 ), a noncitizen who is a veteran or service member shall not be removed from the United States unless the noncitizen has a criminal conviction for a crime of violence. 5. Naturalization through service in the Armed Forces of the United States Notwithstanding any other provision of law, a noncitizen who has obtained the status of a noncitizen lawfully admitted for permanent residence pursuant to section 2 shall be eligible for naturalization through service in the Armed Forces of the United States under sections 328 and 329 of the Immigration and Nationality Act ( 8 U.S.C. 1439 ; 1440), except that— (1) the ground or grounds on which the noncitizen was ordered removed, or removed, from the United States, or was rendered inadmissible to, or deportable from, the United States, shall be disregarded when determining whether the noncitizen is a person of good moral character