The long-stay student visa issued by the Spanish consulate in your country before you traveled. It is a sticker glued inside your passport.
Applied for at the Spanish consulate in your country before arrival. If your stay is longer than 180 days, this visa must be exchanged for a TIE within 30 days of arriving in Spain.