The piece was written shortly after Shostakovich was diagnosed with myelitis. According to the score, it is dedicated "to the victims of fascism and war" but Shostakovich's daughter, Galina, stated that Shostakovich secretly dedicated it to himself. Shostakovich's friend, Lev Lebedinsky, said that Shostakovich thought of the work as his epitaph and that he planned to commit suicide around this time.
The work was written in Dresden, where Shostakovich he was to write music for the film Five Days, Five Nights. The quartet is in five movements:
The work is filled with quotes of other pieces by Shostakovich: the first movement quotes his Symphony No. 1 and Symphony No. 5; the second movement uses a Jewish theme first used by Shostakovich in his Piano Trio No. 2; the third movement quotes the Cello Concerto No. 1; and the fourth movement quotes a 19th century revolutionary song and Shostakovich's opera, Lady Macbeth of the Mtensk District.