The County of Foix (, ; ) was an independent medieval fief in southern France, and later a province of France, whose territory corresponded roughly the eastern part of the modern département of Ariège (the western part of Ariège being Couserans). During the Middle Ages, the county of Foix was ruled by the counts of Foix, whose castle overlooks the town of Foix. In 1290 the counts of Foix acquired the viscountcy Béarn, which became the center of their domain, and from that time on the counts of Foix rarely resided in the county of Foix, preferring the richer and more verdant Béarn. The county of Foix was an independent fief of the kingdom of France and consisted of an agglomeration of small holdings ruled by lords, who, though subordinate to the counts of Foix, had some voice in the government of the county. The provincial estates of the county, a legislative body that can be traced back to the 14th century, consisted of three orders and possessed considerable power and energy. In the 17th and 18th centuries Foix formed one of the thirty-three , or military areas, of France and kept its provincial estates until the French Revolution. In 1790 it was joined with Couserans to form the of Ariège. The county of Foix, as it existed just before the French Revolution, had a land area of 2,466 km2 (952 sq. miles). At the 1999 census there were 76,809 inhabitants living on the territory of the former province of the county of Foix, which means a density of only 32 inh. per km2 (84 inh. per sq. miles). The largest urban areas are Pamiers, with 17,715 inhabitants in 1999, and Foix, with 10,378 inhabitants in 1999. History House of Foix The Counts of Foix flourished from the 11th to the 15th century. They were at first feudatories of the counts of Toulouse and the counts of Barcelona, but after the latter's defeat in the Cathar Crusade they succeeded in establishing their direct vassalage to the king of France. During the 13th and 14th centuries the counts of Foix figured among the most powerful of the French feudal nobles. Living on the borders of France, having constant interaction with the Kingdom of Navarre, and in frequent communication with England through Gascony and Aquitaine, they were in a position favorable to an assertion of independence, and acted more like the equals