In the year 1640, due to the growth it had achieved, Philip IV granted Llerena the title of City.
By the end of the 17th century began the city's decline influenced by several factors: the political crisis in the Spanish Empire, war with Portugal, little suitable local rulers, the Moorish expulsion and successive plagues which kept isolated from the outside during quarantine.