When did Madrid become the capitol of Spain?

Madrid became the capital of Spain in 1561, during the reign of King Phillip II. Before that, Toledo had been the capital city since the 6th century.
Copyright Wanderlust World © https://www.ynyoo.com