A huge blaze tore through an ancient Spanish church as firefighters battled to save the building from ruin.

Dramatic footage shows thick smoke billowing out from the historic UNESCO-listed mosque-cathedral of Cordoba on Friday night, as flames lapped at its roof.

The Spanish city's mayor said firefighters quickly contained the blaze and saved the church - which is a major tourist attraction visited by two million people per year.

'The monument is saved. There will be no spread, it will not be a catastrophe, let's put it that way,' José María Bellido stated on Cadena television.

Although the fire is considered almost extinguished, firefighters continue to cool the area to prevent it from spreading.