In
ancient times a
Baltic tribe, the
Curonians, inhabited
Courland and had strong links with the maritime tribes in both sides of the Baltic sea. In 1230, Lamekinas, Duke of West Courland, signed an agreement with the vice-legat
Baldwin of Alna (
Baudoin d’Aulne) of the
Pope Gregory IX about the voluntary conversion of his people to Christianity and receiving the same rights as the inhabitants of
Gotland. In 1234
Dominican friar Engelbert was appointed to be the first bishop of Courland. In 1242 the area of Courland passed under the influence of the
Teutonic Knights owing to the amalgamation of this order with that of the
Brethren of the Sword in 1237. In 1253 the territory of Courland was divided between the Bishopric of Courland and the Livonian branch of the Order of Teutonic Knights. After severe defeat of knights in the
Battle of Durbe the Bishop Heinrich von Lützelburg left Courland in 1263 and the new bishop
Edmund of Werth returned in his bishopric only after suppression of Curonian and Semigallian insurgencies in 1290. Duke Magnus was crowned King of
Livonia in 1570. In 1577, having lost Ivan's favor and receiving no support from his brother, Magnus called on the Livonian nobility to rally to him in a struggle against foreign occupation. He was attacked by Ivan's forces and taken prisoner. On his release, he renounced his royal title. Magnus spent the last six years of his life at the castle of
Pilten, where he died as a pensioner of the Polish crown. He promised to transfer it to the Duchy of Courland after his death, but this plan failed and only later
Wilhelm Kettler did regain this district. After Magnus of Livonia died in 1583,
Polish–Lithuanian Commonwealth invaded his territories in the
Duchy of Courland and
Frederick II of Denmark decided to sell his rights of
inheritance.{{cite web|url= https://denstoredanske.lex.dk/Magnus_af_%C3%98sel |title = Magnus af Øsel == Chronology ==