In the Spanish-speaking world it is common to write names in the following way:
First name(s) + father's last name + mother's last name
The last name used for family name, identification, etc. is the father's last name--its function is the "last name."
It is not a "middle name" even though it appears between the first name(s) and the mother's last name (what you might call the "mother's maiden name").
Here are some examples:
José Manuel Cureño Naranjo (last name = Cureño)
Edna Vila Aguilera (last name = Vila)
María Victoria Villasana Rivadeneyra (last name = Villasana)
A seemingly minor bookkeeping or bureaucratic error in which the mother's maiden name is erroneously presumed to be the last name can essentially change someone's identity.
Because of this, many Latinos in the U.S. either hyphenate the two names or drop the mother's last name.