On 20 June 1939 Prokofiev's close friend and professional associate, the director Vsevolod Meyerhold, was arrested by the NKVD just before he was due to rehearse Prokofiev's new opera Semyon Kotko; he was shot on 2 February 1940. Although his death was not publicly acknowledged, let alone widely known about until after Stalin's reign, the brutal murder of Meyerhold's wife, Zinaida Raikh, less than a month after his arrest was a notorious event. Only months afterwards, Prokofiev was 'invited' to compose Zdravitsa to celebrate Joseph Stalin's 60th birthday. Later that year, Prokofiev started composing his Piano Sonatas Nos 6, 7, and 8, Opp. 82–84, widely known today as the "War Sonatas." These sonatas contain some of Prokofiev's most dissonant music for the piano. Biographer Daniel Jaffé has argued that Prokofiev, "having forced himself to compose a cheerful evocation of the nirvana Stalin wanted everyone to believe he had created" then subsequently, in these three sonatas, "expressed his true feelings". It was therefore ironic that Sonata No. 7 received a Stalin Prize.
The Allegro inquieto pays homage to and mocks the classical sonata form. As the tempo suggests, the tempo and rhythms are very nervous and suspenseful. The opening theme is mocking and harsh, and features many loud cluster-like chords. The second theme is a slow, thoughtful theme that seems to wander both through various keys and harmonies, and motifs. This long section begins to slowly pick up and results in the tumultuous, extremely chromatic and violent development. After reprising a portion of the slow section, a final quick, mocking fragment of the main theme is presented which ends in the only full statement of the key of the piece with a quiet, quick roll of the B major chord. The music is labeled as being in the key of B-flat major, and contains musical elements pointing to B-flat as a home note in the vein of the classical sonata form: a first theme centered on B-flat, a second theme whose iteration in the exposition is centered on A-flat and whose iteration in the recapitulation is centered on B-flat, and an ending that returns the tonal center to B-flat and concludes the piece with a B-flat major chord. However, this movement distinctively lacks the key signature of B-flat major.
2. Andante caloroso
The slow section is initially very beautiful, but seeping with sentimental emotion. Jaffé has pointed out that the opening theme is based on Robert Schumann's Lied, 'Wehmut' : the words to this translate "I can sometimes sing as if I were glad, yet secretly tears well and so free my heart. Nightingales... sing their song of longing from their dungeon's depth... everyone delights, yet no one feels the pain, the deep sorrow in the song." This opening theme quickly decays into an extremely chromatic section which sifts through various tonal centers, none of which seem familiar to the E that began the piece. After a clangorous, bell-like climax, the music slows and melts into the lush opening theme once more.
3. Precipitato
The Precipitato finale, once described as "an explosive burst of rock 'n' roll with a chromatic edge", is a toccata which boldly affirms the key of the sonata through a more diatonic harmonic language than found in the first movement. This is obvious from the very beginning, with simple B major triads repeated over and over again. Despite a wide range of performance tempos chosen by different pianists, the effect is nevertheless imposing and exciting. The toccata culminates into a furious recapitulation of the main theme, taxing all ten fingers to the utmost, until the piece finally ends triumphantly in a thundering cascade of octaves. The precipitato of this sonata is regarded as technically highly demanding.