I had been living in Spain for the last 16 months (under Non Lucrative Residence permit), and owned 1 property in Spain.

I would like to cancel my residency in Spain (i.e. changing from residents to non-resident status)

Could I just leave Spain for more than 6 months, and my residency in Spain would be automatically cancelled? i.e. I just need to come back , say 8 months later to change the residency status and inform my bank to change to non-resident account.

OR

Do I need to inform any government agencies now of this intention before I even leave the country?

What is the procedure to deregister the residency status?