The NIE (Número de Identificación de Extranjero), meaning – Foreigners Identification Number, is the identification number issued to people who are not a Spanish nationals.
The National Police, (Cuerpo Nacional de Policia), handle the issue of NIE’s, and any one planning to carry out a transaction in Spain, e.g. buying a car, holiday home, or various other interests, needs to have one.
The NIE identifies you whenever you do something official, or which involves the authorities. For example paying taxes, buying a property; signing a document at Notary; starting a business; or becoming a director of a Spanish company.
The NIE is not a fiscal (tax) residency identification – you can have a NIE and be fiscal resident in another country, however it is used to link payments to you that may be due, including tax amongst others. Both EU citizens and non-EU citizens are issued with NIE’s, and if you become resident, you keep the same NIE when you apply for your residence certificate or card.