Prokofiev composed his 6th, 7th and 8th sonatas, collectively known as his “war sonatas”, between 1939 and 1944. In 1939, the same year as the 8th sonata was conceived, Prokofiev met Mira Abramovna Mendelson, with whom he would have an affair. Before this is had been 16 years since Prokofiev had last composed a piano sonata and presumably it was his meeting with Mira that inspired this renewed period of interest. By 1941 Prokofiev had left his wife Lina and was living with Mira. In 1947 the Soviets issued a decree annulling all marriages of Soviets to foreign nationals, thus ending Lina and Prokofiev’s marriage and allowing Prokofiev to have a civil ceremony with Mira. Things only got worse for Lina when in 1948 she was jailed by the Soviets on accusations of espionage. Lina spent until 1972 in jail and on her release still claimed to be Prokofiev’s only legitimate wife.
Prokofiev finished his 8th sonata in 1944 and dedicated it to Mira. The first performance was by Emil Gilels at the Grand Hall of the Moscow Conservatory on 30th December 1944; Prokofiev decided his previously fearsome piano technique had slipped and thus entrusted Gilels with the first performance.
The 8th sonata met with considerable praise and was awarded a Stalin Prize. Hailed as one of the greatest works of the 20th century, Sviatoslav Richter hailed it as Prokofiev’s greatest contribution to the sonata “the richest of all – an abundance of riches”. Barbara Nissman said “a masterwork of the 20th century keyboard literature; it expands the sonata, not only in terms of structure but as a total concept; it is the equivalent of a large scale symphony for piano”.  
The first movement is marked “dolce” and lives up to the composers own statement that the sonata is primarily “lyrical in character”. The development increases in intensity and reaches a significant climax only to return in the recapitulation to the initial dolce opening. The second movement “andante sognando” is dream-like accompanied by some typically Profofiev – style harmonies. The finale is in a 3 part form. The inner section revisits material from the 1st movement whilst the outer two sections are energised by triplet movement and forceful octaves.