1. As used in this section : a. “Minor” means a person who is under eighteen years of age or who is enrolled in a secondary school. b. “School” means a public or nonpublic elementary or secondary school. c. “Sex offender” means a person required to be registered under this chapter who has been convicted of an aggravated offense against a minor. 2. A sex offender shall not reside within two thousand feet of the real property comprising a school or a child care facility. 3. A sex offender residing within two thousand feet of the real property comprising a school or a child care facility does not commit a violation of this section if any of the following apply: a. The sex offender is required to serve a sentence at a jail, prison, juvenile facility, or other correctional institution or facility. b. The sex offender is subject to an order of commitment under chapter 229A . c. The sex offender has established a residence prior to July 1, 2002. d. The sex offender has established a residence prior to any newly located school or child care facility being established. e. The sex offender is a minor. f. The sex offender is a protected person in a guardianship, and a district judge or associate probate judge grants an exemption from the residency restriction. g. The sex offender is a patient or resident at a health care facility as defined in section 135C.1 or a patient in a hospice program, and a district judge or associate probate judge grants an exemption from the residency restriction. 2009 Acts, ch 119, §14 ; 2024 Acts, ch 1009, §97 Referred to in §692A.107 , 692A.109 , 692A.111 , 692A.121 , 692A.123 , 692A.129