Niebla's history dates back 3,000 years. The town's early importance was due to the silver industry, exploited by
Phoenician traders by the 8th century B.C. The town was a commercial and political centre known as
Ilipla in Roman times. By 713 the town of Ilipla was under Muslim control. The town became part of the
emirate of Cordoba in 756 and further fortifications were constructed. From 1023 Niebla became the capital of the Taifa of Niebla, whose army fought the
Taifa of Seville. The battle was lost and Niebla fell under the control of Seville in 1053. Islamic rule began to weaken after 1212, and the town was conquered in 1262 by
Alfonso X of Castile. Descriptions of the siege suggest that this town was the place where
gunpowder was first used in Spain. During the last third of the 19th century, the railway arrived in the municipality. In 1875, the
Riotinto Railway entered service, linking Huelva with the
Riotinto-Nerva mining basin and had its own station in the municipality of Niebla. Five years later, the Seville-Huelva line was put into service, which also had its own station in Niebla. Furthermore, in 1896, a connecting station was installed in the Las Mallas area to allow freight exchanges between trains on the Riotinto and Seville-Huelva lines. Railway activity remained very active until the closure of the Riotinto line in 1984. In 1982, the historic center of Niebla was declared
Conjunto Monumental Histórico-Artístico. == Ecclesiastical history ==