Madrid, the capital of Spain, lies at the geographical center of the country. In 865, the Emir of Cordoba, Muhammad I, built a fortress on the banks of the River Manzanares, named Magerit. Muslim domination ended in 1083, and Madrid fell into the hands of Alfonso VI: Jews, Catholics and Muslims lived together in the area. In 1202, Alfonso VIII established a forum there to provide justice, appointments to public office and enforce payment of taxes. In 1561, Philip II, King of Spain, moved the Court to Madrid from Toledo, making it the capital of the Spanish empire. Population and culture both boomed during an age known as the Siglo de Oro, a high point for Spanish art and literature. Churches, monasteries, palaces and monuments were built.
In 1734, Philip V, the first monarch of the Bourbon dynasty in Spain, ordered the construction of the Palacio Real on the ruins of an Arab fortress destroyed by fire. Charles III, who took the throne beginning in 1759, changed Madrid’s urban landscape, adding lighting, paved roads and a network of sewers. The city enjoyed its finest moment: the King also built Puerta de Alcalá, the Paseo del Prado, the Botanic Garden, the Cibeles fountain and many museums and academies. On May 2, 1808 the inhabitants of Madrid gathered in front of the Palacio Real to rebel against the French domination of Napoleon. The insurgency was violently suppressed, marking the beginning of the Spanish War of Independence. Eleven years later, the Prado museum, which houses royal collections, was opened to the public . Modernization of the city began in the mid-1800s. The first railway line was built in 1851, followed a few years later by gas lighting. In 1910, construction work began on the Gran Via, the city’s main artery, while the first subway began running in 1919. The Spanish Civil War broke out in 1936: Madrid was the scene of street fights, battles and bombings. Nationalist General Francisco Franco, who won the war in 1939, established a dictatorial regime that lasted 36 years.
Following Franco’s death and the first democratic elections,  Madrid’s population rediscovered freedom in the form of nightlife and culture, giving birth to la movida. On March 11, 2004, a terrorist attack hit Madrid: 191 dead and 2,000 injured. Initially thought to be the work of ETA, Basque separatists whose violence has haunted the country and the capital, the attack was later attributed to Islamic militant groups. The city rose up once again. In constant development, Madrid is Spain’s economic engine.