Johannes Brahms composed his Sonata for Piano no. 2 in F sharp minor, Op. 2, in Hamburg in 1852, and published it the following year. Despite being his second published work, it was actually finished before his first piano sonata. Both sonatas were sent to to Breitkopf und Härtel with a letter of recommendation from Robert Schumann.