The castle of Montealegre, built in the 12th century, was mentioned for the first time in 1173, when Rodrígo Gutiérrez was appointed lord of Montealegre; together with the castles of Ampudia, Belmonte, Torremormojón, Medina de Rioseco, Mucientes and Trigueros, it formed the defence line of the southern border of the Kingdom of León. The castle was revamped in 1297 by Alfonso Tello Pérez de Meneses, appointed lord of Montealegre by King Alfonso VIII.
In the 13th century, the domain was transferred to the Order of Saint James, which granted a charter to the village in 1219. Further owners of Montealegre were the Albuquerque (14th century), who defended the castle against King of Castile Peter the Cruel in 1354, and the Manuel (15th-17th centuries). The Manuel family maintained in the town one of the most significant Jewish communities in the province. In 1626, Montealegre became a Marquisate, granted by King Philip IV to Martín de Rojas y Guzmán.
The present castle, with its austere and strong appearance, has a slightly trapezial groundplan, with four strong towers at its corners. Three of them are rectangular and the fourth is pentagonal and served as the keep. In the middle of its curtain walls it is fitted with slender circular towers. The height of its walls range from 18 to 24 meters with a thickness of 4 meters. With its functional and horizontal impression it represents an adoption of a Mediterranean-Arab castle, a style known in Europe from the 13th century.References:
The eight towns in south-eastern Sicily, including Ragusa, were all rebuilt after 1693 on or beside towns existing at the time of the earthquake which took place in that year. They represent a considerable collective undertaking, successfully carried out at a high level of architectural and artistic achievement. Keeping within the late Baroque style of the day, they also depict distinctive innovations in town planning and urban building. Together with seven other cities in the Val di Noto, it is part of a UNESCO World Heritage Site.
In 1693 Ragusa was devastated by a huge earthquake, which killed some 5,000 inhabitants. Following this catastrophe the city was largely rebuilt, and many Baroque buildings from this time remain in the city. Most of the population moved to a new settlement in the former district of Patro, calling this new municipality 'Ragusa Superiore' (Upper Ragusa) and the ancient city 'Ragusa Inferiore' (Lower Ragusa). The two cities remained separated until 1926, when they were fused together to become a provincial capital in 1927.