In August 1938, Stalin brought Beria to Moscow as deputy head of the People's Commissariat for Internal Affairs (NKVD), the ministry which oversaw the state security and police forces. Under Nikolai Yezhov, the NKVD carried out the Great Purge: the imprisonment or execution of millions of people throughout the Soviet Union as alleged "enemies of the people." By 1938, however, the oppression had become so extensive that it was damaging the infrastructure, economy and even the armed forces of the Soviet state, prompting Stalin to wind the purge down. Stalin had thoughts to appoint Lazar Kaganovich as head of the NKVD, but chose Beria probably because he was a professional secret policeman. In September, Beria was appointed head of the Main Administration of State Security (GUGB) of the NKVD, and in November he succeeded Yezhov as NKVD head (Yezhov was executed in 1940). The NKVD was purged next, with half its personnel replaced by Beria loyalists, many of them from the Caucasus. He reportedly won Stalin's favour in the early 1930s after faking a conspiracy to assassinate the Soviet leader that he then claimed to have foiled. In 1938 Stalin rewarded Beria's loyalty by making him head of the NKVD. One account says Beria personally strangled his predecessor, Nikolai Yezhov.