score:0
The answer to your question is early 18th century, and we could specifically focus on the year of the end of the war of Spanish succession that is 1714: at that time, the kingdom of Spain was created when Castile, Aragon and other provinces of Spain that had unified to lead the Reconquista and were commanded by the same King were officially integrated with each other.
As you understand in previous sentence, there could be a distinction between the word "Spain" and the entity of Spain that existed far before 1714: Mark C Wallace cited 1516, because of the promulgation of Nueva Planta decrees by Philip V. We could also consider 1469, when the personal union of the Crowns of Castile and Aragon created a major Christian power in the Hispanic Peninsula, that led the Reconquista.