In the space of three months in 1788 Mozart composed his last three symphonies—No. 39 in E Flat, No. 40 in G Minor, and No. 41 in C, called the Jupiter Symphony; they all display a complete mastery of classical symphonic form as established by Haydn. In 1789 Mozart traveled to Berlin, where he was presented to King Frederick William II. Mozart's last three string quartets (1789–90) were written for the king, an accomplished cellist. Returning to Vienna, Mozart composed his clarinet quintet (1789); his last opera buffa, Così fan tutte (1790), and his last piano concerto, the Piano Concerto in B Flat (1791).
In Die Zauberflöte ( The Magic Flute, 1791), with libretto by the actor Emmanuel Schikaneder, Mozart returned to the German opera in the singspiel, bringing this form of light musical entertainment to a height of lyrical and symbolic art. Its composition was interrupted by a commission from a wealthy nobleman for a requiem mass and by the composition of La Clemenza di Tito (1791), an opera seria for the coronation of Leopold II as king of Bohemia.
After the production of Die Zauberflöte, Mozart worked feverishly on the requiem, with the foreboding that it would commemorate his own death. He died at the age of 35 without finishing it; the work was completed by his pupil Franz Süssmayr. A thematic catalog of Mozart's works was made by Ludwig von Köchel and published in 1862; an edition revised by Alfred Einstein appearing in 1937. Mozart's works are usually identified by their numbers in this list.