In 1228, Governor Abu Zakariya seized power and, a year later, took the title of Emir and founded the Hafsid dynasty. The city became the capital of a Hafsid kingdom stretching towards Tripoli and Fez. Walls were built to protect the emerging principal town of the kingdom, surrounding the medina, the kasbah, and the new suburbs of Tunis. In 1270 the city was taken briefly by Louis IX of France, who was hoping to convert the Hafsid sovereign to Christianity. King Louis easily captured Carthage, but his army soon fell victim to an outbreak of dysentery. Louis himself died before the walls of the capital and his army were forced out.  At the same time, driven by the reconquest of Spain, the first Andalusian Muslims and Jews arrived in Tunis and would become of importance to the economic prosperity of the Hafsid capital and the development of its intellectual life.