The history of Warsaw spans over 1400 years. In that time, the city evolved from a cluster of villages to the capital of a major European power, the Polish–Lithuanian Commonwealth—and, under the patronage of its kings, a center of enlightenment and otherwise unknown tolerance. Fortified settlements founded in the 9th century form the core of the city, in today's Warsaw Old Town.

The city has had a particularly tumultuous history for a European city. It experienced numerous plagues, invasions, and devastating fires. The most destructive events include the Deluge, the Great Northern War (1702, 1704, 1705), War of the Polish Succession, Warsaw Uprising (1794), Battle of Praga and the Massacre of Praga inhabitants, November Uprising, January Uprising, World War I, Siege of Warsaw (1939) and aerial bombardment—and the Warsaw Ghetto Uprising, Warsaw Uprising (after which the German occupiers razed the city).

The city has hosted many crucial events in the history of Poland. It was the site of election of Polish kings, meeting of Polish parliament (Sejm), and events such as the Polish victory over the Bolsheviks at the Vistula, during the Battle of Warsaw (1920). In recent years the history-laden city has grown to become the multicultural capital of a modern European state and a major commercial and cultural centre of Central Europe.

Early history

The first fortified settlements on the site of today's Warsaw were Bródno (9th or 10th century), Kamion (11th century) and Jazdów (12th or 13th century). Bródno was a small settlement in the north-eastern part of today's Warsaw, burned about 1040 during the uprising of Miecław, one of the Mazovian local princes. Kamion was established about 1065 close to the today's Warszawa Wschodnia station (today, Kamionek estate), Jazdów—before 1250 by the today's Sejm. Jazdów was raided twice—in 1262 by Lithuanians, in 1281 by the Płock Prince Bolesław II of Masovia. Then, a new similar settlement was established on the site of a small fishing village called Warszowa, c. north of Jazdów—by the same Prince Bolesław II. The Bolesław's brother and successor, Konrad II, built a wooden castellan, which was burned—again by the Lithuanians. On this place, the prince ordered the building of a brick church, which obtained the name of St. John and became a cathedral.

The first historical document attesting to the existence of a Warsaw castellan dates to 1313. Fuller information about the age of the city is contained in the court case against the Teutonic Knights, which took place in Warsaw cathedral in 1339. In the beginning of the 14th century it became one of the seats of the Dukes of Masovia, becoming the capital of Masovia in 1413 (Prince Janusz II). Warsaw's economy of the 14th century rested on crafts and trade. The townsmen, of uniform nationality at the time, were marked by a great disparity in their financial status. At the top were the rich patricians while the plebeians formed the lower strata.

At that time, Warsaw housed about 4500 people. In the 15th century, the town spread beyond the northern town wall, and a settlement, New Town, began. The existing settlement became known as Old Town. Each had its own town charter and government. The aim of establishing a new town was to regulate the settling of new people who weren't allowed to settle in Old Town (mainly Jews).

In 1515, during the Muscovy-Lithuanian War, fire (probably lit by Russian agents) burned a large part of Old Warsaw.Dariusz Kaczmarczyk, Kościół Św. Anny, Warsaw 1984, p. 34. Gross social inequality and wealth disparity led in 1525 to the first revolt of the poor of Warsaw against the rich and their abuse of power. This struggle resulted in the so-called third order being added to the city's authorities, sharing power with the two bodies controlled by the patrician class: the council and the assessors. The story of Warsaw's struggle for social liberation dates from this time.

Upon the extinction of the local ducal line, the duchy was reincorporated into the Polish Crown in 1526 (according to gossip, the last Mazovian prince, Janusz III, was poisoned on the orders of the Polish queen, Bona Sforza, and King Sigismund I).

1529–1699

In 1529, Warsaw for the first time became the seat of the General Sejm, where it has remained ever since. To house the Sejm, an Italian architect, Giovanni di Quadro, was contracted to rebuild the King's Castle in the Renaissance style. The incorporation of Mazovia into the Polish Crown led to fast economic development, as illustrated by the rapid growth of the population to 20,000 people compared to c. 4500 people a century earlier.

However, by 1575 (when Stephen Báthory became the Polish king), assemblies were held in another Warsovian suburb at Wielka Wola (now the city's western district, Wola). The stormiest elections were those of 1575 and 1587, when matters came to blows between the divided nobles. Following an election, the king-elect was obliged to sign the pacta conventa (Latin: "agreed accords"), laundry lists of campaign promises, seldom fulfilled, with his noble electors. The agreements included "King Henry's Articles" (artykuły henrykowskie), first imposed on Prince Henri de Valois (in Polish, Henryk Walezy) at the outset of his brief reign (upon the death of his brother, French King Charles IX, Henri de Valois fled Poland by night to claim the French throne).

Due to its central location between the Polish–Lithuanian Commonwealth's capitals of Kraków and Vilnius, as well as its relative closeness to Gdańsk, from where Sweden was always threatening, Warsaw became the capital of the Commonwealth and at the same time of the Polish Crown in 1596, when King Sigismund III Vasa moved the court from Kraków. The King's decision had been brought forward by the fire of Cracovian Wawel Castle. The royal architect, Santa Gucci, started to rebuild the Warsovian Castle in the Baroque style, so the King only lived there temporarily, but in 1611 he moved there for good. At the time of Warsaw's transformation from one of the main Polish towns into the country's capital, it already numbered some 14,000 inhabitants. The old walled city had 169 houses; the new Warsaw outside the walls numbered 204 houses, while the suburbs had as many as 320. In 1576, the first permanent bridge was built on the Vistula; it was destroyed in 1603 by an ice floe and until 1775 there was no permanent connection between Warsaw and Praga on the Vistula's right bank.

In the following years, the town expanded into the suburbs. Several private independent districts were established, the property of aristocrats and the gentry, which were ruled by their own laws. Such districts were called jurydyka. They were settled by craftsmen and tradesmen. One of these “jurydykas” was Praga, which granted a city charter in 1648. The peak of their development came in the wake of Warsaw's revival after the Swedish invasion, which had seriously ravaged the city. Three times between 1655 and 1658 the city was under siege and three times it was taken and pillaged by the Swedish, Brandenburgian and Transylvanian forces. They stole many valuable books, pictures, sculptures and other works of art - mainly, the Swedish troops. The mid-17th-century architecture of the Old and New Towns survived until Nazi invasion. The style was late Renaissance with Gothic ground floors preserved from the fire of 1607. In the 17th and early part of the 18th century, during the rule of the great nobles oligarchy, magnificent Baroque residences rose all around Warsaw. In 1677, King John III Sobieski started to build his Baroque residence in Wilanów, a village c. south of Old Town.

In 1647, benefiting from Poland's tolerance, Valerianus Magnus publicly performed a vacuum experiment (Torricelli's experiment), which contradicted official European science.

In the 17th century, Warsaw became a significant destination for the migration of Armenians, Scots, and Italians, including from other parts of Poland. It was one of the largest Italian and Scottish communities in Poland, and in 1691 Scottish immigrant Alexander Chalmers was even elected mayor of the Old Town. Since 1672, the Armenian community of Warsaw gained importance and grew, as many Armenians fled there from Podolia during the Polish–Ottoman War of 1672–1676. Warsaw has become the most important center of Armenians in Poland outside the area of their main settlement in southeastern Poland. Four Polish Armenians were mayors of the Old Town. In the 18th century, there was an Armenian Catholic chapel at the St. John's Collegiate Church.Stopka, p. 36

1700–1795

A number of political circumstances ensured that after the death of King John III's, Poland–Lithuania entered into a period of decline relative to the other powers of Europe. A new king, the Saxon Prince-Elector Frederic Augustus was elected in 1697, who took the name Augustus II. The new monarch was more concerned with the fortunes of his mother country, the Electorate of Saxony, than of Poland. At the same time, the Polish gentry began to intensively fight for their own rights against the Crown with less thought for maintaining the kingdom's position obtained in the 17th century. Moreover, the rulers of the neighboring Russian Empire (Peter I the Great) and Swedish Empire (Charles XII) were gradually extending their territories and strengthening their power. In 1700, the Great Northern War broke out between these two states; Augustus II recklessly joined it on Peter I's side. The decentralized Polish Crown lacked sufficient power to assert itself in the Great Northern War, which led to Poland to becoming a battlefield between the two neighbouring kingdoms. Warsaw was besieged several times; the first time, in 1702, by Swedish Army troops. The city suffered severely from the Swedish occupation. Under the Swedish influence, in June 1704 the Polish gentry dethroned Augustus II and at Wielka Wola elected a new king, the pro-Swedish Poznań Voivod Stanisław Leszczyński. Shortly afterwards, the tides of war changed and on September 1, 1704, Warsaw was retaken by the Saxon army of Augustus II after five days of a severe artillery bombardment. Augustus in turn lost Warsaw after being defeated in a battle fought on 31 July 1705. In this action, which took place between today's Warszawa Zachodnia station and Wielka Wola, 2,000 Swedish troops defeated 10,000 soldiers of the Polish-Lithuanian-Saxon army Only now Stanisław Leszczyński could be officially crowned, which took place in October of that year. In 1707, by virtue of the peace treaty between Augustus II and Charles XII, Imperial Russian Army troops entered Warsaw. After two months, Russian forces were removed from Warsaw. Several times during the Northern war the city was obliged to pay heavy contributions. Leszczyński reigned until 1709, when Russia defeated Sweden in the Battle of Poltava, forcing the Swedish army to leave Poland. Following the Swedish defeat, Augustus II once again became the King of Poland. From 1713 onwards, the Russian and Saxon troops were permanently stationed in Warsaw, which led to an oppressive occupation. Besides the tribulations of war, Warsaw was hit by pest (1708), flood (1713) and poor crops.