The composer wrote the first three movements in Leningrad and completed the work in Kuibyshev (now Samara) where he and his family had been evacuated.
Po izbruhu vojne med Sovjetsko zvezo in Nemčijo leta 1941 je Šostakovič sprva ostal v Leningradu.