Hierro was appointed acting coach after a surprise sacking of Julen Lopetegui who accepted to take over at Real Madrid.
The 48-year-old will have the tough task of reviving a national team deflated after three consecutive failures at major tournaments, the latest their World Cup loss to hosts Russian Federation - ranked 70th in the world - on penalties in the last 16.
Hierro has made a decision to "seek new horizons", according to the Spanish football federation (RFEF).
The Royal Spanish Football Federation (RFEF) have confirmed that Fernando Hierro will no longer continue with the federation after Spain's shock World Cup exit at the knockout stages. Spain left the tournament after winning just one game.
Elon Musk offers to help Thailand's government with cave rescue
He has now designed a plan to help save the boys, and he said engineers from his companies would travel to Thailand on Saturday . However, the fate of the boys trapped in the Tham Luang cave complex in northern Chiang Rai province remained unclear.
The former Barcelona manager, who was favoured ahead of the other candidates Quique Sánchez Flores y Michel, will be officially presented as new head coach of the national setup in the coming days.
Luis Enrique had last been manager of Barcelona till 2017.
The 48-year-old won two La Liga titles and the Champions League with the Catalan side before stepping down last year.
Luis Enrique previously coached FC Barcelona, where he won the treble in 2014-15, as well as playing 62 times for Spain, which included appearances at three World Cups (1994, 1998 and 2002).
A statement said the former Real Madrid player had "declined" to return to his previous role and will instead "undertake new professional challenges".