Online application from Spain
Apply while you are legally in Spain. The initial permit lasts up to 3 years (or the length of your employment contract if shorter) and can be renewed. Later you may qualify for long-term residence if you meet the requirements.
