It is not vital but it could make your visit to Spain easier. The Spanish government are now issuing official invitations to make travel easier for non-residents. The document, which is issued by the National Police, can be sought by anyone who is legally resident in Spain so that they can invite friends and family to visit. The invitation contains the name, the address where they will be staying and also their reason for visiting.
The Spanish police say that there is no legal requirement to have the document but it could make your life easier when entering the country if you are not staying in a hotel or apartment complex.
For non-resident Britons it is another document on top of the 90 day rule which means that non-European Union citizens can only spends 180 days a year in Spain (in two blocks of two, non-residents).
The invitation can be obtained from any National Police station.
"Having this document could tip the balance in your favour if you are having problems with immigration.
Additional reading