There are fifteen universities based in Scotland, the Open University, and three other institutions of higher education.
The first university in Scotland was the University of St Andrews, founded in 1413, with St John's College being added in 1418 and St Salvator's College in 1450. The other great bishoprics followed, with the University of Glasgow being founded in 1451 and King's College, Aberdeen in 1495. St Leonard's College was founded at St Andrews in 1511 and St John's College was re-founded in 1538 as St Mary's College. Public lectures that were established in Edinburgh in the 1540s would eventually become the University of Edinburgh in 1582. A university briefly existed in Fraserburgh between 1592 and 1605. In 1641, the two colleges at Aberdeen were united by decree of Charles I (r. 1625–49), to form the ‘King Charles University of Aberdeen’. They were demerged after the Restoration in 1661. In 1747 St Leonard's College in St Andrews was merged into St Salvator's College to form the United College of St Salvator and St Leonard. A new college of St Andrews was opened in Dundee in 1883, though initially an independent institution. The two colleges at Aberdeen were considered too small to be viable and they were restructured as the University of Aberdeen in 1860. Marischal College was rebuilt in the Gothic style from 1900. The University of Edinburgh was taken out of the care of the city and established on a similar basis to the other ancient universities.