The first mention of the city comes from 1323, when the creator of the Grand Duchy of Lithuania, Gediminas, erected a wooden castle (called High Castle) on Castle Hill and moved the capital from Trakai to Vilnius. The Grand Duke of Lithuania and Polish King Władysław Jagiełło granted the city Magdeburg rights in 1387 and began to bring settlers. In 1441, Kazimierz Jagiellończyk confirmed city rights. In the years 1503-1522 defensive walls were built. The most splendid period in the history of the city was the Sigismund times. A mint, arsenal, mills, a bridge over Wilejka, numerous hospitals and palaces arose at that time. Vilnius has become a city of many nationalities. In 1579, King Stefan Batory founded the Jesuit Academy, which became the nucleus of the Vilnius University.
The town's development was seriously stopped by a great fire in 1610. In 1639 religious riots took place; Calvinists were forced to leave the city. On 7 August 1655, during the Polish-Russian war, after the occupation of the city in which the local people had taken refuge from many castles, the Russians murdered about 25,000 people. The fires in the Lithuanian capital lasted for 17 days. The next blow was the Northern War.
In the nineteenth century, Vilnius was a place of development for numerous Polish patriotic organizations, e.g. filarets, philomats, the Patriotic Union and Szubrawcy (Rascals). In the summer of 1823, mass arrests of Polish youth took place in Vilnius. At that time, Adam Mickiewicz studied and was imprisoned in the city.
In 1915-1918 Vilnius was occupied by the Germans. After the retreat of the Germans, the Polish-Lithuanian conflict over Vilnius flared up. During the 1920 war, the city was conquered twice by the Red Army. On 12 July 1920, the Soviet government concluded an agreement with the Lithuanian government, under which, inter alia, Vilnius and Suwalszczyzna were to be given to Lithuania. By escaping, the Soviets handed Vilnius over to Lithuanians. Piłsudski decided to solve the problem in an unusual way. To take Vilnius he went to a trick. He commissioned General Lucjan Żeligowski, commander of the Lithuanian-Belarusian Infantry Division, to fake a "rebellion" and enter Vilnius. On October 9, 1920, Żeligowski's troops entered the city. The creation of Central Lithuania was proclaimed. On February 20, 1922, the Central Lithuanian Seym adopted a resolution to include Central Lithuania in Poland; Vilnius became the capital of the Vilnius province.
On 19 September 1939, despite the city's defense by scouts and middle school students, Vilnius was occupied by the Soviet army. On 26 October 1939, the Soviets handed the city over to Lithuanians, but on 15 June 1940, they seized it again. On 14 July 1940, deportations of the inhabitants of Vilnius to Siberia began. During the war, persecution and deportation covered about 35,000 inhabitants of the Vilnius region, mainly of Polish origin. On 22 June 1941, the Germans bombed the city and seized it a few days later. On 7 July 1944, the Polish Home Army focused near the city launched an attack on Vilnius (Operation Gate Gate). A few days after the arrival of the Red Army, the NKVD arrested all Polish soldiers and officers, and plucked Vilnius from Polish hands. Then Lithuania and Vilnius were re-incorporated into the Soviet Union. After 1944, most Polish residents were resettled. Since then, Lithuanians and Russians began to settle in Vilnius.
Independence movements initiated in June 1988 by the Lithuanian Movement for Reconstruction (Sajudis) intensified in 1990, and in January 1991 there were clashes by the television tower. Vilnius has been the capital of independent Lithuania since 17 September 1991.