Secondary education in the United States is the last six or seven years of statutory formal education, including grade 6 (age 11–12) or grade 7 (age 12–13) (varies by states and sometimes by district) through grade 12 (age 17–18). It occurs in two phases. The first is the ISCED lower secondary phase, a middle school or junior high school for students grade 6 (age 11–12) through grade 8 (age 13–14). The second is the ISCED upper secondary phase, a high school or senior high school for students grade 9 (age 14–15) through grade 12 (age 17–18). There is some debate over the optimum age of transfer, and variation in some states; also, middle school often includes grades that are almost always considered primary school.