Unless there is a legal instrument providing exemption from that obligation, all foreign public documents must be legalised in order to be valid in Spain, and all Spanish public documents must be legalised to be valid abroad.
Further information on this can be found here.