The name was also given to a short-lived wartime state existing from March 8 to September 22, 1918. Plans for it to become part of the United Baltic Duchy, subject to the German Empire, were thwarted by Germany's surrender of the Baltic region at the end of the First World War. The area became a part of Latvia at the end of World War I; ''see Duchy of Courland and Semigallia (1918).
In 1562, during the Livonian Wars, the Livonian Confederation was dismembered and the Livonian Brothers of the Sword, an order of German knights, was disbanded. On the basis of the Vilnius Pact, the southern part of Estonia and the northern part of Latvia were ceded to the Grand Duchy of Lithuania and formed into the Ducatus Ultradunensis (Pārdaugavas hercogiste). The part of Latvia between the west bank of the Daugava River and the Baltic Sea became the Duchy of Courland and Semigallia, nominally a vassal state of the Grand Duke of Lithuania.
Gotthard Kettler, the last Master of the Order of Livonia, became the first duke of Courland. Other members of the Order became the Courland nobility, with the fiefdoms they had hitherto held becoming their estates. In all, Kettler received nearly one-third of the land in the new duchy. Mitau (Jelgava) was designated as the new capital and a Diet was to meet there twice a year.
Several parts of the Courland area did not belong to the Duchy. The Order of Livonia had already loaned the Grobiņa district (on the coast of Baltic Sea) to the Duke of Prussia. Another district, the Bishopric of Piltene, also called the "Bishopric of Courland" (on the Venta River in western Courland), belonged to Magnus, son of the king of Denmark. He promised to transfer it to the Duchy of Courland after his death, but this plan failed and only later did Wilhelm Kettler regain this district.
Like the other members of the Order, Kettler was German and set about establishing the Duchy along the lines of similar German states. In 1570, he issued the Privilegnum Gotthardinum, which allowed the landholders to enserf the native peasanty on their lands.
When Gotthard Kettler died in 1587, his sons, Friedrich and Wilhelm, became the dukes of Courland. They divided the Duchy into two parts in 1596. Friedrich controlled the eastern part, Semigalia (Zemgale), with his residence in Jelgava (Mittau). Wilhelm owned the western part, Courland (Kurzeme), with his residence in Kuldīga (Goldingen). Wilhelm regained the Grobiņa district when he married the daughter of the Duke of Prussia. He also paid out and regained control over the Piltene district, but eventually it fell to the Polish-Lithuanian Commonwealth. Here he developed metalworking, shipyards, and the new ships delivered the goods of Courland to other countries.
However, relations between the duke and the landowners were quite hostile. In addition, the Commonwealth, the overlord of the Duchy of Courland, supported the landowners. Wilhelm expressed his disappointment with the landowners, but this ended with his removal from the duke's seat in 1616. Finally, Wilhelm left Courland and spent the rest of his life abroad. Thus, Friedrich became the only duke of Courland after 1616.
From 1600 to 1629, the Polish-Lithuanian Commonwealth and Sweden conducted a war with its main battlefields around Riga. As the result, Sweden gained control of central and northern Latvia, which became Swedish Livonia. The Commonwealth retained the eastern part of the Duchy of Livonia, thereafter called Inflanty Voivodeship in Polish. Courland was also involved in this war, but did not suffer severe damage.
Under the next duke, Jacob Kettler, the Duchy reached the peak of its prosperity. During his travels in Western Europe, Jacob became the eager proponent of mercantilist ideas. Metalworking and ship building became much more developed, and powder mills began producing gunpowder. Trading relations developed not only with nearby countries, but also with Britain, France, the Netherlands, Portugal, etc. Jacob established the merchant fleet of the Duchy of Courland, with its main harbours in Ventspils and Liepāja.
However, during this time, the Duchy of Courland remained an object of interest for both Sweden and the Polish-Lithuanian Commonwealth. In 1655 the Swedish army entered the territory of the Duchy and the Swedish–Polish war (1655–60) had begun. The Swedish army captured Duke Jacob (1658–60). During this period, the Dutch took over both of Courland's colonies, and the merchant fleet and factories suffered destruction. This war ended with the peace Treaty of Oliwa (1660). Courland regained Tobago on the basis of the treaty and held it until 1689. Duke Jacob set about restoring the fleet and factories, but the Duchy of Courland never again reached its pre-war level of prosperity.
The next Duke, Friedrich Wilhelm Kettler, was only six years old when he succeeded in 1698, and he was under the regency of his uncle Ferdinand — a Polish general. During this time the Great Northern War (1700–21) began between Sweden and Russia with its allies — the Commonwealth, Saxony and Denmark. As a result of the war, Russia took control of the central part of Latvia starting in 1710. In Courland, Russia also had such a strong influence that its ambassador, Peter Bestuzhev, became the most powerful man in the duchy. The Tsar of Russia, Peter the Great, received a promise from Friedrich Wilhelm that he would marry one of the daughters of the tsar's brother. By having this promise, Peter the Great wished to increase the influence of Russia in Courland. So, in 1710, Friedrich Wilhelm married Anna Ivanovna (later Empress of Russia), but on his way back from St Petersburg, he took ill and died. Anne ruled as duchess of Courland from 1711 to 1730.
After the death of Friedrich Wilhelm, the next candidate for the seat of duke was Ferdinand Kettler, but his residence was in Danzig. Because the law required the duke to reside within the Duchy, the Diet did not recognize him. Because Ferdinand was the last representative of Kettler's family, a remarkable number of candidates tried to gain the seat of duke during this period. One favorite was Maurice de Saxe, natural son of Frederick Augustus I the Strong, king of Poland. He was elected duke in 1726, but only managed to maintain himself by force of arms till the next year. Russia disliked him and sent an army to western Courland to destroy Maurice's base. As the result Maurice had to leave Courland and Russia increased its influence further. The last Kettler, Ferdinand, titular duke of Courland, died in 1737. Anna Ivanovna, the wife of Friedrich Wilhelm, and Empress of Russia, appointed Ernst Johann von Biron duke of Courland in 1737.
Von Biron received remarkable financial support from Russia and invested it in construction - for example, the castle of Schloss Ruhenthal projected by the distinguished Italian architect Bartolomeo Rastrelli. Anna Ivanovna died in 1740, resulting in von Biron's exile to Siberia the following year. From there, through the Council of the Duke, he continued to control the Duchy, having accept from the king of Poland. However, the landowners of Courland disliked that and even refused to follow the regulations of the Council of the Duke.
Louis Ernest of Brunswick-Lüneburg was selected as Ernst Johann von Biron's successor on 27 June 1741 with the support of his cousin Maria Theresa of Austria, but whilst in St Petersburg to get this title ratified, Elizabeth of Russia carried out a coup on 6 December 1741 and he lost the title.