After the Red Army invasion of Azerbaijan on 28 April 1920, Azerbaijan Democratic Republic ceased to exist. Gaplanov was subsequently arrested in June 1920 along with many Azerbaijani statesmen and sent to Moscow prison. He was later released and taught a course on Turkish History at the Moscow Institute of Oriental Studies. Gaplanov was arrested as a part of the Great Purge on 8 October 1937 and imprisoned at Butyrskaya and then Lefortovo prisons. He was executed on 10 December 1937.