From 1271 to 1318 Thessaly was an independent despotate that extended to Acarnania and Aetolia, run by John I Doukas. In 1309 the Almogavars or Catalan Company of the East ("Societas Catalanorum Magna"), settled in Thessaly. In 1310, after lifting the siege of Thessalonica, the Almogavars withdrew as mercenaries in the pay of the "sebastokrator" John II Doukas and took over the country. From there they departed to the Duchy of Athens, called by the duke Walter I. In 1318, with the extinction of the Angelid dynasty, the Almogavars occupied Siderokastron and southern Thessaly (1319) and formed the Duchy of Neopatria.