The immigration authorities may grant a temporary residence permit on the grounds of arraigo, as well as for humanitarian reasons, cooperation with police or judicial authorities, or other exceptional circumstances defined by law.
Arraigo is one of these cases, granting the applicant temporary residency that allows them to live in Spain legally and even obtain a work permit.