Define the middle layer graph as the graph whose vertex set consists of all bitstrings of length \(2n+1\) that have exactly \(n\) or \(n+1\) entries equal to 1, with an edge between any two vertices for which the corresponding bitstrings differ in exactly one bit. The middle levels conjecture asserts that this graph has a Hamilton cycle for every \(n\geq 1\). This conjecture originated probably with Havel, Buck and Wiedemann, but has also been attributed to Dejter, Erd\H{o}s, Trotter and various others, and despite considerable efforts it remained open during the last 30 years. In this paper we prove the middle levels conjecture. In fact, we construct \(2^{2^{\Omega(n)}}\) different Hamilton cycles in the middle layer graph, which is best possible.