18-9003. illegal entry from foreign nation. (1) A person who is an alien commits an offense if the person enters or attempts to enter this state at any location other than a lawful port of entry or through another manner of lawful entry. (2) A violation of this section shall be a misdemeanor upon a first conviction. A second or subsequent conviction shall be a felony. (3) Law enforcement officers may enforce the provisions of this section only when a person is detained or investigated for suspected commission of an independent crime under title 18, Idaho Code, excluding this chapter, or under chapter 27, title 37, Idaho Code. (4) It shall be an affirmative defense to prosecution under this section that: (a) The federal government has granted the defendant: (i) Lawful presence in the United States; or (ii) Asylum under 8 U.S.C. 1158; (b) The defendant’s conduct does not constitute a violation of 8 U.S.C. 1325(a); (c) The defendant was not investigated for, charged with, or convicted of committing the independent crime for which the defendant was detained or investigated pursuant to subsection (3) of this section; or (d) The defendant was approved for benefits under the federal deferred action for childhood arrivals program between June 15, 2012, and July 16, 2021. (5) The following federal programs do not provide an affirmative defense for purposes of subsection (4)(a) of this section: (a) The deferred action for parents of Americans and lawful permanent residents program; and (b) Any program not enacted by the United States congress that is a successor to or materially similar to the program described by subsection (4)(d) or paragraph (a) of this subsection. (6) Notwithstanding any other provision of law to the contrary, a defendant shall not be eligible for deferred adjudication or a withheld judgment if the defendant is charged with or convicted of an offense pursuant to this section.