Valencia announced on Thursday that Marcelino will take the reins of the team for next season.
Marcelino had been out of a job since being surprisingly dismissed by Villarreal in August.
The 51-year-old successfully steered Villarreal from the Segunda Division to three straight top-six finishes in La Liga as well as reaching the semifinals of the Europa League in the 2015-16 campaign before his departure last summer.
A Valencia statement read: "Valencia CF and Marcelino Garcia Toral have reached a full agreement for him to be first team head coach for a minimum period of two seasons. His official presentation will be done following the final La Liga game and until then, the parties will not make any public statements."
Marcelino will take over from Voro Gonzalez, the club delegate and former Valencia player who assumed temporary charge of the team after Cesare Prandelli's resignation in December. Former Italy coach Prandelli had just three months earlier been appointed after the dismissal of Pako Ayestaran.
Valencia have had many struggles on and off the pitch since Singapore-based owner Peter Lim bought the club in October 2014.
Valencia were in relegation danger earlier this season but they responded well after Voro agreed to lead the team after Prandelli's departure.
Voro is popular among the players and fans but recently said he wanted to relinquish the reins after the campaign.
Valencia, who have won six La Liga crowns in their history, are 13th in the standings with two games of the season remaining.