The NKVD was created in early 1918 to handle policing and internal affairs. However, it did not obtain state security functions until it took over the OGPU in July 1934. State security functions were then handled by the NKVD's GUGB ("Glavnoe Upravlenie Gosudarstvennoe Bezopasnosti" or Main Directorate of State Security). On 8 February 1941, the Special Sections of the NKVD (responsible for counter-intelligence in the military) were given to the Army and Navy (NKO and NKVMF) where they became the SMERSH (from Smert' Shpionam or "Death to Spies"). In April 1943, GUGB was removed from NKVD and renamed NKGB.
During World War II, NKVD units were used for rear area security, including halting deserters. On "liberated" territory the NKVD and NKGB carried out mass arrest and deportations, at times sending entire populations (650,000+ Crimean Tatars, Chechens, Ingush, and others) to Central Asia. In 1946, the NKVD was transformed into the MVD. The MVD in turn evolved into the KGB.
Leaders of Soviet political police 1917 - 1991
See also: History of the Soviet Union