According to the CIA World Factbook, Spain became independent in 1492. The Iberian Peninsula, on which Spain is located, was formerly occupied by a loose scattering of kingdoms. This lasted until the eighth century A.D., when Muslim forces conquered the area.
Spain did not gain its independence until almost seven centuries later, after Christians from the north conquered the Muslims. The seizure of Grenada is considered the touchstone of Spain's independence. Subsequently, the kingdoms of Spain united and led the way to what today is considered modern Spain.
During its time under Muslim occupation, Spain was considered a center of culture and education.