Spanish: habitational name from what is now Spain's principal city. Throughout the Middle Ages it was of only modest size and importance, and did not become the capital of Spain until 1561. Its name is of uncertain origin, most probably a derivative of Late Latin matrix, genitive matricis ‘riverbed’, much changed by Arabic mediation. Compare Madrigal. There are other, smaller places of the same name in the provinces of Burgos and Santander, and these may also be sources of the surname.