DESPITE being relocated to a new town built eight kilometres away by Franco in 1971, a hodge-podge community of stubborn residents still cling on to life in the 13th-century fortress that served as a defensive stronghold during the Christian Reconquista.
Castellar de la Frontera is one of the few villages in Spain still entirely enclosed within medieval walls from its perch high above the cork oak forests of the Campo de Gibraltar,
Its maze of whitewashed houses, cobbled alleys and hidden courtyards are hemmed in by a Nasrid castle that once guarded the frontier between Christian and Muslim kingdoms.
READ MORE: 'War is better than socialism': One in five Spaniards believe the Franco era was either 'good or very good', according to new poll
Built in the 1200s when the village was known as Al-Qars, the fortress draws clear inspiration from Granada's Alhambra, with battlemented towers, arched gateways and carved stone lintels that still bear the marks of its Moorish past.
After the Christian conquest, it became the seat of the Counts of Castellar, whose palace at the heart of the fortress has since been restored and transformed into a small hotel.
Guests can now sleep in rooms once reserved for nobles and soldiers, surrounded by thick stone walls that have stood for eight centuries.
At the centre of the old town stands the Church of the Divine Saviour, joined to the castle by a covered passageway -- a rare medieval feature linking faith and fortification.
READ MORE: Six Spanish towns are still named after Franco, and no one's stopping them
Outside, the Balcón de los Amorosos offers a panoramic view across the valley, where the green mantle of the Parque Natural de los Alcornocales stretches to the horizon.
The park is one of the largest protected forests in Spain, known as the selva del sur - the southern jungle - for its dense cork oak canopy and constant humidity from the nearby Strait of Gibraltar.
Here, the air is alive with birdsong and the orange flash of migrating monarch butterflies that pass through the trees each year.
A 17-kilometre circular hiking route known as the Butterfly Trail links the Guadarranque reservoir viewpoint with La Almoraima, crossing old bridges and riverside paths once used by cork harvesters.
READ MORE: Travel podcast includes Spanish city in its top five most overrated in the world for one very notorious problem
Along the way, walkers pass monumental trees, moss-covered ruins and the former Convent of San Miguel de la Almoraima, now a luxury hotel.
Down below the old fortress, Castellar el Nuevo tells a different story.
Built under Franco's rural resettlement programme, it replaced the cramped medieval village with wide streets, tiled plazas and modern amenities.
Yet despite the move, a handful of families refused to leave the castle - and over time, artists, artisans and hoteliers joined them, bringing new life to the old stone walls.
READ MORE: 'Wake-up call' for Brits: Second homeowners in Spain face travel bans when 90/180 'blind eye' regime ends next week
Every year, residents of both towns reunite during the local feria, filling the castle with music, food and laughter that spill into the narrow lanes until dawn.
Few places in Andalucía bring together history, nature and community quite like Castellar de la Frontera.
It is a village that has endured empires, exile and time itself - still standing guard above the southern jungle, where butterflies drift through the mist and the fortress breathes on.