In 1989, about 270 thousand Russians lived on the territory of modern Chechnya — almost a quarter of the population. 210 thousand lived in Grozny, the rest mainly in the Cossack villages along the Terek river. Dzhokhar Dudayev, the leader of Chechnya after the collapse of the USSR, headed for independence and in 1991 declared that the republic was no longer part of Russia. In December 1994, Russian troops attempted to establish control over the rebel region. This operation turned into a protracted war. On August 31, 1996, in the Dagestani city of Khasavyurt, Aslan Maskhadov and General Alexander Lebed signed the peace agreement, which in fact meant the victory of the separatists. In August 1999, following the invasion of Dagestan by militants, the Second Chechen War began, during which Russia has regained control of the republic. Grozny was destroyed twice. Cossack villages in the north of Chechnya, where the Russian population predominated, suffered less, but the majority of inhabitants left them. By 2002, the number of Russians in Chechnya had dropped to 41,000. By 2010 — to 24 thousand, or two percent of the population.