Behind its restored walls are lovely gardens, an impressive eight-sided tower, Arabic baths and a mezquita, or mosque, which King Alfonso had converted into a Christian church. Inspired by the visit, I took the opportunity to roll back the centuries and relax in the modern-day Arabic baths at Hammam Andalusí, Calle Salvador 6. (Open daily 10am-10pm; bath and massage from €32).
Outside the city, on a flat, chalky plain nourished by the Guadalquivir and Guadalete rivers, you see the Arabic horses for which Jerez is celebrated, as well as black fighting bulls and the vineyards of palomino grapes which give sherry its flavour.
Drive eastwards, beyond the motorway linking Cádiz and Sevilla, through the foothills of the Subética mountain range and a new side of the region reveals itself: fertile valleys with orchards and market gardens. Then, huddled against the rugged pine-clad hillsides, there's the sudden, almost shocking, white stain of a village, a "pueblo blanco".
First stop: Arcos de la Frontera, its whiteness enhanced by the contrast with the golden brown of the mighty sandstone cliff on which it perches. This seemingly unassailable position made Arcos an important base for the Moors after Córdoba and Sevilla fell to the troops of the Reconquista.
The town was eventually taken, but the narrow alleyways and sunlit squares of the medina still reflect the typical town planning concepts of the Moors.
Nevertheless, the convents, churches and noble houses subsequently built by the Castilians still blended with the earlier buildings to produce a harmonious whole. Not to be missed are the vertiginous views over the river valley from the main square, the Plaza del Cabildo.
Two roads head eastwards from Arcos towards Ronda. The more northerly, the A382, follows the course of the river Guadalete, passing the huge lake of Bornos and the white towns of Algodonales. Just off the road to the south lies Zahara de la Sierra. Called "a Moorish eagle's nest" by the 19th-century author Richard Ford, it's another cluster of extraordinarily white houses, huddled halfway up a mountainous crag - on the very top of which are the ruins of its Moorish castle.
In nearby Olvera, the castle is even more dramatic and in a better state of preservation. It seems to grow organically out of the pinnacle of rock on which it is built. Tickets to visit it cost €2 from the tourist office (open daily except Sundays from 10.30am-2pm and 4-6pm).
Olvera is also at one end of a very attractive Vía Verde, a path for walkers and cyclists along the route of a railway line that, oddly enough, was abandoned before a train ever ran on it. The 36km track to Puerto Serrano takes you through scary tunnels, past a colony of rare griffon vultures and through the olive groves that gave the town its original name, Olivera.
As a setting for these radiant towns, the countryside loses little by comparison. The Sierra de Grazalema, a visual cocktail of pine-clad limestone crags and poplar-lined valleys, is a natural park and one of Spain's best walking areas. It remains green even at the height of the burning Andalucían summers, thanks to its high and localised rainfall (the pretty village of Grazalema, at the heart of the park, is the wettest place in Spain). The must-do walk here is along the path of La Garganta Verde along the bed of a dramatic canyon to a cave called "La Ermita", whose striking interior of pink rock is decorated with stalactites and stalagmites.
A contrasting landscape is on offer in the Parque Natural los Alcornocales, the Cork-Oak Park, which I reached by taking the road south from Grazalema. The mountains here are lower - high hills really - and are forested with Mediterranean scrub and trees, chief among which are the cork-oaks.
The signposted walk up to the peak of El Picacho is a good way to enjoy the sight of these trees, with their trunks almost indecently stripped of bark. You can also see raptors of all kinds, as well as mongooses - one of the Moorish imports to Iberia. The walk starts from the recreational centre on the A375, south of Ubrique.
On the eastern side of these parks are more frontier towns: Cortes, Jimena and Castellar de la Frontera, linked by road and by a railway line that runs between Algeciras and Ronda - delivering one of Spain's most picturesque train journeys.
Jimena was important to the Moors and was lost and recaptured three times. The walls of its citadel, entered through a striking triple-arched gate, shelter a warren of streets leading to a castle with sweeping views over the coast. But the best views are from the village of Gaucín, on the opposite side of the valley, from where Morocco is clearly visible.
If you'd been here in April 711, you could have seen the forces of the Moorish general Tariq ibn-Ziyad crossing the straits. Today's occupying force, at least in villages like Gaucín, is English-speaking, although the Arabic/Moorish influence is never far away.
I finished my journey with a North African meal in Vejer de la Frontera, a picture-perfect white town, on the coast road between Tarifa and Cádiz. The atmospheric El Jardín del Califa is at Plaza de España 12 (open daily from 11am to 11pm). A staircase led me down from the main square into a palm-filled patio for an excellent chicken tagine. The perfect end to a very Moorish journey.
- INDEPENDENT