The NIE is a foreigner identification number used for Spanish tax and administrative purposes. It does not itself grant residency, but is normally required for a purchase.
NIE is not residency
Identification, tax residence and immigration status are separate concepts.
When to start
Start before completion becomes urgent. Appointment availability, consulates and powers of attorney affect timing.
Bank and notary coordination
NIE, source-of-funds evidence and banking documents should move together, with realistic dates in the deposit contract.

