The Moorish castle of Fadrell, on the summit of the spurs of the Desert Mountains, overlooking the farmsteads on the plain, offered the first shelters for the inhabitants of the region who became the founders of the city. The region was conquered by James I in 1233 and later granted to Ximén Pérez d'Arenós. Under his mandate, the inhabitants moved to the site of the Benirabe farmstead, which became the nucleus of the new town. During the Middle Ages, the city was protected by moats, walls and towers, and a church was built, which later became a procathedral in the mid- 1 5th century. It was in 1366 when the image of the Virgin of Lledó, later to become patron saint of the town, was unearthed by a ploughman named Perot de Granyana. In the 1 7th and 1 8th centuries, the city took part in the revolt of the Germanies (local guilds) and supported archduke Charles of Austria in the War of the Spanish Succession (1701-14), but was later taken by Philip V's troops, together with the rest of the Kingdom of Valencia. In the century that followed, the city walls were torn down and it slowly began to expand, interrupted by the War of Independence ( 180414) and the Carlist Wars (1833-63). In 1833, however, the definitive limits of the province were established, and Castellón de la Plana became capital of the presentday area, including a few frontier towns in Teruel. In the second half of the 1 9th century, the city again began to expand. The first modernist buildings were constructed. The Provincial Hospital, the Casino, the Main Theatre, the Ribalta Park... The port was enlarged and avenues were extended to the seafront. The Valencia-Castellón de la Plana railway was constructed, and a narrow-gauge railway called the Panderola was laid, linking the provincial capital to surrounding towns, opening up new areas for the fast-growing ceramics industries in the province. Today, with a population close to 140,000, Castellón de la Plana is a city which is still strong on growth, with a high quality manufacturing sector and craft industry, and a bustling, modern University Campus.