In 1746 King Philip 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 by Ferdinand VI, who appointed Ventura 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 named Plaza de España) which was linked with another now named Plaza 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 a hospice. Currently only the main facade stands; has been restored and incorporated into the new city hall.