Madrid’s origins are lost in prehistory. Madrid’s history really got going when, in 852, Muslim invaders built a fortress where the Royal Palace stands today. A town sprang up, which fell into Christian hands around 1086 during the Reconquista, a hard-fought struggle for control of the Iberian Peninsula that the Christians finally won in 1492. Madrid grew slowly until 1561, when Philip II made it his capital. This brought in a huge number of courtiers, artists, craftsmen, nobles and hangers-on. Like most European cities of the time, it was crowded, with no sanitation and few public areas. Charles III changed all that in the late-18th century by building El Retiro park, cutting broad avenues through old tenements and erecting huge palaces. He’s still known as the “mayor king.” Madrid’s history had dark days ahead, however, because Napoleon took Spain in 1808. There was a bloody uprising in Madrid on May 2 of that year, but it failed and Spain didn’t get rid of Napoleon for another five years. By then their empire was falling apart and the city stagnated. During the Spanish Civil War (1936-39) Madrid was the capital of the Republic, fighting against Franco’s fascist rebels. Madrid suffered serious bombing, and the fringes of the city were the front line for most of the war. When the Republic fell in 1939 and Franco took over, order was quickly restored, but the city languished. Spain had been a poor country before the war and was now destitute. Many old buildings too battered to be restored got demolished and replaced by uninspiring, concrete high-rises. Others that escaped damage suffered for lack of money for upkeep. The economy slowly improved in the '60s and '70s, and by the '80s democracy had come, the economy was doing well and La Movida was in the air. This flowering of youth culture saw the founding of many of the capital’s pioneering clubs. Restoration work began on older buildings, a process that continues today, although slowed down by the recent global recession, which has hit Spain hard. You wouldn’t know this from Madrid nightlife, as Spaniards are still eating well and partying half the night.