After the death of Ferdinand II, Charles II of Spain sold Teramo to the Duke of Atri for 40,000 ducats. The people of Teramo rebelled, but with no result. In 1626 Teramo was struck by an earthquake, followed four years later by the plague. From 1707, after of the War of the Spanish Succession, the Habsburg Monarchy rules the whole Kingdom of the Two Sicilies for 27 years. During the Age of Enlightenment Teramo is an active centre of intellectual life, especially with Melchiorre Delfico, a notable poet, composer and Italian philosopher. In 1798 French troops entered Teramo, and though they were initially repulsed by the citizens, they returned a few days later, sacking the whole city.