Luis Aragones has agreed to continue as Spain coach until the end of Euro 2008.
Aragones had a rethink over his future with Spain
The 67-year-old had hinted he might resign after his side crashed out of the World Cup after a 3-1 defeat by France in the second round.
But Aragones, who said he would quit unless Spain reached at least the last four, will now target qualification for Euro 2008 in Austria and Switzerland.
"The (Spanish Football) Federation were pleased with my work and this motivated me to extend my contract," he said.
Spain's defeat by France was their first defeat in 26 games since he took charge following the nation's flop at Euro 2004 in Portugal.
Despite continuing their reputation as perennial bridesmaids at major competitions, Aragones' young Spanish side left with hopes high for the future.
"If you want me to say that I made a mistake (at the World Cup), then I will say I made a mistake - even if I think otherwise," said Aragones.
He added: "The European Championships are an important aim and we are going to work hard in order to get there in the best possible shape."