During the 5th century, Germanic tribes occupied the Western Roman Empire and in 476, the last Roman emperor was deposed, marking the beginning of the Middle Ages. In the 8th century, the Moors invaded the Iberian Peninsula and defeated the Visigoths, establishing the territory of Al-Andalus which they ruled for eight centuries until 1492. Al-Andalus became an important center of economic, scientific, and cultural developments, still influencing Spanish language, culture, and customs today. It was a largely urban society with Cordoba, Seville, Malaga, and Granada as the main cities. Hispano-Muslim architecture from this era forms an important part of the world