during ancient times, but the proto-Greek and archaic period remains (Poseidon temple) that were unearthed at Akovitika region prove otherwise. Middle Ages Pharai was rather unimportant in antiquity, and the site continued in obscurity until middle Byzantine times. Kalamata is first mentioned in the 10th-century Life of St. Nikon the Metanoeite, and experienced a period of prosperity in the 11th–12th centuries, as attested by the five surviving churches built in this period, including the Church of the Holy Apostles, as well as the comments of the Arab geographer al-Idrisi, who calls it a "large and populous" town. Following the Fourth Crusade, Kalamata was conquered by Frankish feudal lords William of Champlitte and Geoffrey of Villehardouin in 1205, when its Byzantine fortress was apparently in so bad a state that it could not be defended against them. Thus the town became part of the Principality of Achaea, and after Champlitte granted its possession to Geoffrey of Villehardouin, the town was the center of the Villehardouins' patrimony in the Principality. Prince William II of Villehardouin was born and died there. After William II's death in 1278, Kalamata remained in the hands of his widow, Anna Komnene Doukaina, but when she remarried to Nicholas II of Saint Omer, King Charles of Anjou was loath to see this important castle in the hands of a vassal, and in 1282 Anna exchanged it with lands elsewhere in Messenia. In 1292 or 1293, two local Melingoi Slavic captains managed to capture the fortress of Kalamata by a ruse and, aided by 600 of their fellow villagers, took over the entire lower town as well in the name of the Byzantine emperor, Andronikos II Palaiologos. Constable John Chauderon in vain tried to secure their surrender, and was sent to Constantinople, where Andronikos agreed to hand the town over, but then immediately ordered his governor in Mystras not to do so. In the event, the town was recovered by the Franks through the intercession of a local Greek, a certain Sgouromalles. In 1298, the town formed the dowry of Princess Matilda of Hainaut upon her marriage to Guy II de la Roche. Matilda retained Kalamata as her fief until 1322, when she was dispossessed and the territory reverted to the princely domain. In 1358, Prince Robert gifted the châtellenie of Kalamata (comprising also Port-de-Jonc and Mani) to his wife, Marie de Bourbon, who kept it until her death