The study of spin glasses started some 30 years ago, as a branch of the physics of disordered magnetic systems. In the late 1970's and early 1980's it went through a period of intense activity, when experimental and theoretical physicists discovered that spin glasses exhibit new and remarkable phenomena. However, a real understanding of the behaviour of these systems was not achieved and little progress was made in the next 20 years, especially in mathematical terms. In the 1990’s various related systems were studied with mounting success, most notably, neural networks and random energy models. Since a couple of years the ﬁeld has again entered a phase of exciting development. Some of the main mathematical questions surrounding spin glasses are currently being solved and a full understanding is at hand. In this paper we sketch the main steps in this development, which is interesting not only for the physical and the mathematical relevance of this research ﬁeld, but also because it is an example where scientiﬁc progress follows a tortuous path.