It could be said that the foundation of Spain’s independence was laid by the marriage between Isabella and Ferdinand in 1469 as after their marriage the unification of the various kingdoms of Spain began.
The first of the Kingdoms reigned jointly by Isabella and Ferdinand (Los Reyes Católicos) were Castile and Aragon. Then in 1515 Navarre was formally annexed. The Iberian Peninsula, however, took a little longer. The re-conquest of Granada was imperative to the plan for the unification of Spain under one monarchy and one common religion.
Around 1482 there was much dissension within Granada between the Moorish ruler King Abu’l-Hasan Ali and his brother Muhammad al Zagal and son Muhammad XII (Boabdil). Boabdil’s dissension split the kingdom in two thus making the Christian invasion of their territory easier, but which was not completed until 1492 with the handing over of the keys to the city of Granada by Boabdil.
However, it was only in the early 15th century that many of the remaining Muslims converted to Christianity, and the old mosques were consecrated as Christian Churches. So the actual date of the beginning of Spain’s Independence could be said to have been as late as the 1520s.