<human>:  When did the city of Madrid become the capital of Spain?
<bot>: The city of Madrid has been the capital of Spain since the 15th century. It was first called the Royal City of Madrid, and then later became the Royal City of the Kingdom of Spain.