The town inherited the name from a Moorish castle on the top of the hill of Magdalena (the ), a dominating over a demarcation roughly consisting of the current-day municipalities of Castellón and
Almassora. The area capitulated to
James I of Aragon in 1233. This was followed by a series of attempts to create new settlements in the area starting with the
alqueria of Benimahomet, the first Christian project to leave the castle, with mixed results. Following the 1247 mudéjar revolt, James I decreed the expulsion of the
mudéjares from the area in 1248. The current settlement was however not founded until the 1250s, after James I, on 8 September 1251, granted Ximén Pérez d'Arenós a privilege authorising him to move from the castle to a new unspecified place in the plains (
plana). Tradition claims that the move was completed by the third Sunday of
Lent, 1252. During the
Middle Ages, the city was protected by
moats, walls and
towers, and a church was built, later becoming a cathedral. Due to its geographic proximity to Valencia, the city prospered as a port. During the late medieval period, many members of the community participated in maritime trade, or in industries supporting the merchant community. During the late Middle Ages, the Jewish community of Castellón de la Plana maintained a synagogue and active communal life, but like many communities in Spain, it was dismantled following the
1492 expulsion. In the 16th century the town was one of the last
strongholds in the
Revolta de les Germanies (
local guilds). It also supported
Archduke Charles of Austria in the
War of the Spanish Succession (1701–14), but was later taken by the troops of
Philip d'Anjou. In the 19th century, the city walls were torn down and it slowly began to expand, a process interrupted by the
War of Independence against
Napoleon (1804–14) and the
Carlist Wars (1833–63). In 1833 Castelló became the capital of the newly constituted province. In the second half of the 19th century, the city again began to expand, marked by the arrival of the railway, the enlargement of the port and the construction of representative buildings (Provincial Hospital,
Casino, Theater) and parks. In 1991 a university (
Jaume I University) was established, set upon a modern campus. The local
economy is based on industry, tourism and
craft-work. == Geography and climate ==