The history of Bauska, a city in southern Latvia, dates back to the 13th century. Its early history was driven by its location on the trade road from Zemgale to Lithuania. Over the centuries, Bauska has experienced periods of prosperity, destruction and war, followed by growth.

Prehistory Archaeological excavationsA.Caune, J.Grube Bauska medieval castle and ducal palace 1976 show that in the 1st century BC an ancient Semigallian settlement existed on the hill where Bauska Castle was later built.

Emerging settlement At the beginning of the 13th century, the Bauska mound was part of land, the center of which was on the nearby Mežotne mound. The Lielupe-Mūša trade route to the Samogitians and Aukštaitija lands passed through it. In 1219, Upmale voluntarily accepted the protection of the Bishop of Livonia and became part of the . In 1226, it became a part of the . In 1254, the land of Upmale was divided between the Archbishopric of Riga and the Livonian Order on the left bank of the Lielupe river.

Castle

The city of Bauska developed around Bauska Castle and the surrounding castle settlement. It is first mentioned in 1443 when Livonian Order Master ordered the erection of a fortress on the ancient mound, which was to defend the border with the rival Grand Duchy of Lithuania. As Bauska's region was sparsely populated at that time, the castle was built by ethnic Votes, who were prisoners of war from Novgorod.After the great schism, Novgorod struggled from the beginning of the 13th century against Swedish, Danish, and German crusaders. During the Swedish-Novgorodian Wars, the Swedes invaded lands where some of the population had earlier paid tribute to Novgorod. The Germans had been trying to conquer the Baltic region since the late 12th century. Novgorod went to war 26 times with Sweden and 11 times with the Livonian Brothers of the Sword. The German knights, along with Danish and Swedish feudal lords, launched a series of uncoordinated attacks in 1240–1242. Novgorodian sources mention that a Swedish army was defeated in the Battle of the Neva in 1240. The Baltic German campaigns ended in failure after the Battle on the Ice in 1242. After the foundation of the castle of Viborg in 1293 the Swedes gained a foothold in Karelia. On August 12, 1323, Sweden and Novgorod signed the Treaty of Nöteborg, regulating their border for the first time. In 1495 the Bauska Fortress became the residence of the Livonian Order . In 1558, 1590 and 1601, the Kurzeme Landtag took place in Bauska Castle. The first mention of a craftsman settlement called "Schildburg" ("Vairogmiest"), where craftsmen, fishermen, merchants lived at the confluence of Mūsa and Mēmele, on the fortress of the Pumpkin Peninsula, was in 1518.

Narrow city rights were already granted to this settlement in 1511. There was a Church of St. Gertrude with a cemetery, a pastor's house, a pub, a school built in 1570, landlords' houses, and fishermen's cottages. The foundations of the church were still visible around 1870.

After the military setbacks to the Livonian Order during the Livonian War in 1559, Bauska Castle was forced to be mortgaged to the allied Lithuanians. When the Order ceased to exist after the conclusion of Treaty of Vilnius in 1561, Bauska Castle became part of the Duchy of Courland and Semigallia.

Duchy of Courland and Semigallia On May 11, 1575, a fire broke out in a Duke-owned pub that burned down the entire castle settlement except the church. The protection of the castle and the further growth of the town were limited by its location on a narrow peninsula. In 1584, following the order of the Duke of Courland Gotthard Kettler, the castle settlement was dismantled and residents began to build a new town on the left bank of the Nemunėlis river at the location of the modern Bauska Old Town.

Establishment of the city

Moving from the narrow castle settlement to the new city of Bauska took several years. By 1573, a wooden church was built for the Latvian congregation on the territory of the present-day garden at Trinity Lutheran Church. In 1688, the wooden church was renovated. In 1705, the church was in such a bad condition that the church services for the Latvian congregation were transferred to the German Church of the Holy Spirit. In 1726, funds were raised to repair the church. As repairs were nearing the end in 1733, a fire completely burned down the building.

Between 1591 and 1594, the city built the Church of the Holy Spirit, the first stone building in the city. From 1705 the church services were also held in Latvian.

The Duke of Bauska granted city rights in 1600. In 1609, Duke Friedrich Kettler gave Bauska a stamp with the image of a lion of Courland, now considered the year of the granting of city rights. On July 21, 1615, Bauska was also granted meadows and pastures and on December 18, 1615, the city received the right to build a town hall and shops. In 1635 the city received Procedural Rules.

According to the police regulations approved by Duke Friedrich, Bauska's town council consisted of eight people – a mayor, a captive (judge) and six city councilors. The city introduced taxes and regulated trade and pubs. Begging was permitted for registered beggars, who had to carry a certified tin plate. Lime and brick kilns were built in 1632.

In the 17th century Bauska was the third-largest city of the Duchy of Courland. It had a regular block layout consisting of two main streets parallel to Mēmele, a market square with a town hall, two Lutheran churches and one-story wooden buildings. It had city-made sidewalks and a night watch. Goldsmiths' cunfte There was no shortage of wealthy people in Bauska, as evidenced by the remains of the magnificent pottery found, as well as the establishment of a goldsmiths' cunfte office in 1638. At the request of Bauska goldsmiths Heinrich Tinnes, Bertram Hilbrant, Hans Garding and Berent Boanne, the Duke of Courland issued the Bauska Goldsmiths' Statute in 1638. Four masters had to be in the Bauska goldsmiths' cunfte. The Duke had the right to include another goldsmith at his own discretion in the cunfte. It took three years for a goldsmith apprentice to acquire the position of goldsmith. Bauska goldsmiths made a variety of gold and silver items for the needs of local landlords, churches, merchants and rich farmers. Between 1686 and 1697, goldsmith Tobias Müller worked in Bauska. In 1712, Bauska goldsmith Christoffer Kölsing asked to be admitted to the Jelgava Goldsmith's Cunfte, as all Bauska goldsmiths had died in the Great Northern War plague outbreak. Christoffer Kölsing died in 1732 and was buried in Bauska. Goldsmith Friedrich Hermann Jacobi worked in Bauska from 1749 to 1796.

Wars and plague During the Polish-Swedish War, the Duchy of Courland had been out of production for several years in the early 1620s. Famine broke out and was followed by a plague epidemic of 1623–1625. In September 1625, the troops of Gustavus Adolphus of Sweden occupied and plundered Bauska Castle and the city. By 1629, the city was under Swedish control.

During the Second Northern War, Bauska was occupied by Swedish troops, and then Polish-Lithuanian troops. Duke Jacob Kettler recovered it only in 1660 after paying the Polish-Lithuanian king 10,000 guilders. A plague epidemic broke out again in the city, killing 227 plague victims in just one month. On February 14, 1660, the Bauska City Magistrate ordered the collection of dead bodies on the streets and burial. After the war and the end of the plague, the pre-war activity of Bauska Castle and the city returned as it had survived mostly unharmed.

Shortly after the Great Northern War began in 1700, Bauska was occupied by Saxon troops. It is possible that Bauska Castle was visited by the King of Poland Augustus II the Strong and the Russian Tsar Peter I, who in the winter of 1701 held talks on further war tactics in Biržai Castle. After the victory over the Saxons at the Crossing of the Düna battle in 1701, Bauska was captured by the army of King Charles XII of Sweden and was temporarily taken away by Russian troops in 1705. In 1706, both Bauska Castle and palace were partially blown up by the retreating Russian troops. It was no longer restored and eventually fell into ruins. During the war, two-thirds of the city buildings were also destroyed. The early winter of 1708 cut short the harvest and led to a famine. At the same time, the Great Northern War plague outbreak began. On July 3, 1709, church services were banned in Bauska to prevent the plague from spreading, and the dead were buried outside the burial grounds of churches. After the winter of 1708/1709, only one-third of the pre-war population of Bauska had survived the plague epidemic and famine.

Bauska was ravaged by war and plague until the mid-18th century. In 1762, members of the Magistrate were appointed noblemen and were allowed to carry a sword during their duties.

Kurzeme Province of Russian Empire

After the third partition of Poland in 1795, the Duchy of Courland and Semigallia was acquired by the Russian Empire. Bauska retained its status as the administrative center. In July 1797 the Sofia Musketeer Regiment of the Russian Empire was stationed in the city. In 1806 the first school was opened. In 1799 lightning struck the tall Bauska Church of the Holy Spirit and as a "temporary" replacement, a flat roof was constructed, which has survived to this day.

French invasion During the War of 1812, several battles took place near Bauska, the largest of which was the Battle of Ekau. On July 17, the Commander of the Russian Empire's troops in Bauska, Lieutenant Colonel Kunicki of the Polish Uhlans Regiment, learned of an approaching Prussian intelligence unit, confronted it and launched a battle four versts, or about , from Bauska, but was defeated and forced to retreat in the direction of Iecava (). On July 18, Bauska was captured by the 27th Prussian Division of General Julius von Grawert of the Napoleonic Army Marshal Jacques MacDonald's Prussian Corps on their way toward Riga.

On August 1, Napoleon ordered the establishment of the , a council of eight people led by Count . The townspeople had to pay contributions and were obliged to feed the soldiers, who remained in Bauska until early December. The 7th French Division left the city on December 7.

Post-war development In 1814, when the city plan was created, the city had 108 buildings and 28 building plots. On May 1, 1815, the peak of the tall Lutheran church tower was struck by lightning repeatedly, also destroying the masonry. After the abolition of serfdom in Kurzeme in 1817, the population of the city started to increase.

Following the administrative reform of Courland Province in 1819, Bauska became the center of Bauska County. Beginning in 1820, Jews who had previously lived in a separate settlement behind the river were allowed to settle in Bauska.

In 1823, there were 120 dwellings in Bauska, of which only six were brick, so the city was often devastated by fires. The city had one Lutheran church and two synagogues.

On June 6, 1825, Russian Emperor Alexander I stayed overnight in Bauska.

From November 17, 1831, to January 24, 1832, the Sapper Leib-garde Battalion, which participated in the repression of the November uprising Congress Poland, arrived for winter recreation.

By 1835 the city had a population of 2142. There were two crown schools in Bauska with 61 pupils and two private girls' schools with 18 pupils. There were 17 prisoners in the City Prison.