Established in 1917 as NKVD of Russian SFSR, the agency was originally tasked with conducting regular police work and overseeing the country's prisons and labor camps. It was disbanded in 1930, with its functions being dispersed among other agencies, only to be reinstated as an all-union ministry in 1934.
The functions of the OGPU (the secret police organization) were transferred to the NKVD in 1934, giving it a monopoly over law enforcement activities that lasted until the end of World War II. During this period, the NKVD included both ordinary public order activities, as well as secret police activities. The NKVD is known for its role in political repression and for carrying out the Great Purge under Joseph Stalin. Mobile gas vans were used to execute people without trial during the Great Purge. It was led by Genrikh Yagoda, Nikolai Yezhov and Lavrentiy Beria.
The NKVD undertook mass extrajudicial executions of untold numbers of citizens, and conceived, populated and administered the Gulag system of forced labour camps. Their agents were responsible for the repression of the Kulaks, and the mass deportations of entire nationalities to uninhabited regions of the country. They oversaw the protection of Soviet borders and espionage (which included political assassinations), and enforced Soviet policy in communist movements and puppet governments in other countries, most notably the repression and massacres in Poland.
In March 1946 all People's Commissariats were renamed to Ministries, and the NKVD became the Ministry of Internal Affairs (MVD).
After the Russian February Revolution of 1917, the Provisional Government dissolved the Tsarist police and set up the People's Militsiya. The subsequent Russian October Revolution of 1917 saw a seizure of state power led by Lenin and the Bolsheviks, who established a new Bolshevik regime, the Russian Soviet Federative Socialist Republic (RSFSR). The Provisional Government's Ministry of Internal Affairs (MVD), formerly under Georgy Lvov (from March 1917) and then under Nikolai Avksentiev (from 6 August 1917) and Alexei Nikitin (from 8 October 1917), turned into NKVD (People's Commissariat of Internal Affairs) under a People's Commissar. However, the NKVD apparatus was overwhelmed by duties inherited from MVD, such as the supervision of the local governments and firefighting, and the Workers' and Peasants' Militsiya staffed by proletarians was largely inexperienced and unqualified. Realizing that it was left with no capable security force, the Council of People's Commissars of the RSFSR established (20 December 1917) a secret political police, the Cheka, led by Felix Dzerzhinsky. It gained the right to undertake quick non-judicial trials and executions, if that was deemed necessary in order to "protect the Russian Socialist-Communist revolution".