In 1746 KingPhilip V bought the area where San Fernando now stands to install a royal fabric factory. After the king's death shortly thereafter, the project was developed byFerdinand VI, who appointedVentura de Argumosa as the governor of the Royal Place.
Around the factory workers' dwellings were built, which resulted in the origin of the town. In front of the factory a great square was opened (at present namedPlaza de España) which was linked with another now namedPlaza de Fernando VI. The whole area has been recently declared a historic and artistic monument so it cannot be modified, to protect the original houses that still remain.
Throughout its 200-year history, the municipality has suffered ups and downs. Its emblematic building, the factory, has been intended for several uses, notably as ahospice. Currently only the mainfaçade stands; has been restored and incorporated into the new city hall.