Settlement began developing in the Mitau locality between the rivers Lielupe and Driksa during the 10th century. Led by the Grand Master
Konrad von Mandern, the crusading
Livonian Order constructed the
castle in Mitau on a natural island fortification (
Pilssala) in 1265–1266. Using Mitau as a southern fortress, the German knights subdued the surrounding Livonians and Semigallians by 1290. The town rose in importance as a defensive fixture against the
Lithuanians to the south, who succeeded in plundering Mitau in 1345. As a result of the fall of the Livonian Order in the
Livonian War of 1558-1583, Mitau became a town of the
Duchy of Courland in 1561. Mitau received city rights in 1573, and became the capital of the united duchies of Courland and Semigallia in 1578. When the Duchy of Courland split in 1596, Mitau became the residence of Duke
Friedrich Kettler of Semigallia. The city again became the capital of the united duchies in 1617. Because the duchy became a
vassal of the
Polish–Lithuanian Commonwealth from 1561, Mitau was also referred to by the Polish name
Mitawa. The Commonwealth's repeated wars with
Sweden subjected Mitau to several sieges. Despite the wars, the city grew as a center for trade and industry. As Courland's neighbors increased in strength, however, the duchy - and Mitau - began to fall under Russia's
sphere of influence. The
Tsar of Russia,
Peter the Great, received a promise from duke
Friedrich Wilhelm that he would marry one of the daughters of the tsar's late half-brother. In 1710, Friedrich Wilhelm married
Anna Ioannovna (daughter of Tsar Ivan V (), and herself later Empress of Russia), but on his way back from
St Petersburg, he took ill and died (1711). Anna ruled as the duchess of Courland from 1711 to 1730. , established by Duke
Peter von Biron in 1775 The penultimate duke of Courland,
Ernst Johann von Biron ( and 1763–1769), expanded the cultural aspects of Mitau. He constructed the ducal palace and opened the first public library in the city. In 1775 the last Duke of Courland,
Peter von Biron (), founded the
Academia Petrina, which became a cultural center for the country. The duke also encouraged theatrical performances at his court. With the outbreak of the
French Revolution in 1789, the citizens of Mitau clamored for more rights. Later,
Imperial Russia annexed the city as part of Courland in 1795 during the
Third Partition of Poland. The
Count of Provence lived at the palace of Mitau (1798–1801 and 1804–1807) before he became the French king
Louis XVIII in 1814. Although the city was occupied by
Prussian troops during the
Napoleonic Wars, it was largely spared destruction. Mitau further expanded after the
construction of its railway in 1868. The development of its infrastructure encouraged rural Latvians to migrate to the city, as merchants, craftsmen, teachers, and officials. By 1914 Mitau had over 45,000 inhabitants. However, Mitau suffered considerably after the outbreak of
World War I in 1914. The spirited defence of Mitau by two battalions of the Latvian Home Guard in 1915 helped inspire the formation of the
Latvian Rifles.
German troops occupied the city during the war, and British prisoners of war, sent there as forced labour, suffered atrocious conditions and treatment. After the war, in 1919, Mitau became a battleground between
Bolshevik Red Guards, German
paramilitaries, and Latvian freedom-fighters. After the
victory of the latter group in November 1919, Mitau renamed to Jelgava, became an important city in
independent Latvia. In 1925 a
sugar factory was built in Jelgava, the first such factory in Latvia. In 1939
Jelgava Academy of Agriculture opened in the
Jelgava Palace. As a result of the
Nazi-Soviet Pact of 1939, Jelgava was occupied and annexed with the rest of Latvia by the
Soviet Union in 1940. Many of the city's remaining German population were resettled into the territory of German-occupied Poland during the
Nazi–Soviet population transfers. German forces from
Army Group North occupied Jelgava from 1941 to 1944 until the re-capture of the city by the
Red Army. During
World War II, German police along with Latvian auxiliary police murdered the Jewish inhabitants of the city during a series of mass shootings (see
Jelgava massacres). The main synagogue was burned to the ground. fight in the streets of Jelgava in the summer of 1944 In late July 1944, the Soviet
Red army launched an attack from the south in the direction of Jelgava and
Tukums to encircle the German
Army Group North. Jelgava was declared a fortress (
Festung) however, there were only a few scattered German and Latvian units in the city. From 30 July until 7 August, after heavy street fighting and several
air raids, the Red Army managed to occupy the left bank of the Lielupe river. In late August, the German army launched a counterattack on Jelgava from the north but it failed to drive back the Soviets. Jelgava remained on the frontline until 10 October when the German army retreated to
Courland. The city's historic centre, industry, rail network, and public buildings were heavily damaged by the fighting, with almost 90% of the city destroyed. Among lost buildings was famous
Kurland Provincial Museum and Athenaeum. Jelgava was rebuilt in typical Soviet style after
World War II as part of the
Latvian SSR. Jelgava became home to several big factories. Among them were the sugar factory, which was heavily expanded from 1975
assembly line, and administration buildings for the
Riga Autobus Factory (RAF). Following Latvian independence, Jelgava has slowly regained its original Germanic heritage and is now a popular tourist site. Owing to Latvia University of Life Sciences and Technologies, many of Jelgava's inhabitants are students or people connected with education. For this reason Jelgava is sometimes called the
Student capital of Latvia. ==Climate==