The work was completed on 25 July 1788. The composition occupied an exceptionally productive period of just a few weeks in 1788, during which time he also completed the 39th and 41st symphonies (26 June and 10 August, respectively)