Makhachkala is the capital city of the Republic of Dagestan, Russia. It is located on the western shore of the Caspian Sea and is home to the Makhachkala Grand Mosque, one of Russia's largest. As of the 2010 Census, the city had a population of 572,076, making it the largest in the North Caucasus Federal District. The city has an ethnic plurality, with the Avars and Kumyks being the largest groups. Founded as a fortress of the Russian Empire in 1844 and given city status thirteen years later, the city bore the name of the Russian Tsar Peter the Great until 1921. Since the fall of the Soviet Union, Makhachkala has been affected by Islamist insurgents as spillover from the Second Chechen War when militants invaded Dagestan leading to a renewed conflict between the Russian Federation and militants in the North Caucasus region. It was previously known as Petrovskoye , Petrovsk-Port .