Mongols destroyed the Romanesque cathedral in Zagreb during their scourge in 1242, but right after their departure Zagreb got the title of a free city from Hungarian King Béla IV. Soon after, bishop Timotej began to rebuild the cathedral in the new Gothic style. This was a building with three naves, polygonal apses, and rib-vault and it had Romanesque round towers. The naves were built in the 14th century, and the vault was finished in 15th. With the arrival of Turks in the 16th century, high walls and towers surrounded it. Only one tower was finished in the 17th century, while in the 18th the Baroque roof became the landmark of the entire city. An earthquake in 1880 severely damaged the cathedral. With the restoration in the 19th century in the Neo-gothic style, it lost its former harmony.