The Fantasia in F minor by Franz Schubert, D.940 (Op. posth. 103), for piano four-hands (two players at one piano), is one of Schubert’s most important works for more than one pianist and one of his most important piano works altogether. Schubert composed it in 1828, the last year of his life, and dedicated it to his pupil, Karoline Esterházy.
Musicologist Christopher Gibbs has characterized the work as "among not only his greatest but his most original" compositions for piano duet.
Schubert began writing the Fantasia in January 1828 in Vienna. The work was completed in March of that year, and first performed in May. Schubert's friend Eduard von Bauernfeld recorded in his diary on May 9 that a memorable duet was played, by Schubert and Franz Lachner. The work was dedicated to Karoline Esterházy, with whom Schubert was in (unrequited) love.
Schubert died in November 1828. After his death, his friends and family undertook to have a number of his works published. This work is one of those pieces; it was published by Anton Diabelli in March 1829. The original manuscript resides at the Austrian National Library.
The Fantasia is divided into four movements, that are interconnected and played without pause. A typical performance takes about 20 minutes.
The basic idea of a fantasia with four connected movements also appears in Schubert's Wanderer Fantasy, and represents a stylistic bridge between the traditional sonata form and the essentially free-form tone poem. The basic structure of the two fantasies is essentially the same: allegro, slow movement, scherzo, allegro with fugue. The form of this work, with its relatively tight structure (more so than the fantasias of Beethoven and Mozart), was influential on the work of Franz Liszt, who arranged the Wanderer Fantasy as a piano concerto, among other transcriptions he made of Schubert's music.