For a half millennium or more, Madrid idled as a provincial backwater, rarely noticed on the arid central plains of Castile, until Felipe II plucked it from his royal cap in 1561 and proclaimed it the capital of Spain.
Madrid became the capital of Spain as the decision of Felipe II.