According to the 1978 constitution, elementary education is compulsory and free, and university autonomy is recognized. During 1999, primary schools enrolled 2,567,012 pupils and had a pupil-teacher ratio of 15 to 1. In 1997, secondary schools had 3,852,102 pupils and approximately 275,000 teachers. In 2000, adult illiteracy was estimated at 2.3% (males, 1.4%; females, 3.2%). As of 1999, public expenditure on education was estimated at 4.5% of GDP.
Students in higher education numbered 1,684,445 in 1997. The Pontifical University of Salamanca, founded in 1254, is the oldest university, while the University of Madrid has the largest student body.