Rafael Benitez says he will be leaving Napoli following the final game of the Italian club's season on Sunday.
The Spaniard, 55, is favourite to take over at Real Madrid, who sacked coach Carlo Ancelotti on Monday.
"I want to thank the chairman, club and fans because after two years my experience here in Napoli is coming to an end," said Benitez.
"On Sunday, we have a very important match and I want to finish my two years with a victory."
Napoli, in fourth, host third-placed Lazio in their last game of the Serie A season with a Champions League place at stake.
Benitez's side are three points behind their rivals and a win would see them qualify for Europe's premier club competition on the basis of a better head-to-head record.
Benitez refused to discuss his future and the prospect of taking charge at Real Madrid, where he had stints as a youth coach, Under-19 coach and assistant first-team coach in the 1990s.
"The family has been the key to my choice," he added. "Napoli and [president] Aurelio [De Laurentiis] have made every effort and we were close to renewal."
If Benitez does become Real boss, he will return to manage in his homeland for the first time since leaving Valencia to take charge of Liverpool in 2004.
He won two La Liga titles and the Uefa Cup with Valencia, and led Liverpool to Champions League glory in 2005.
Napoli won the Italian Cup and Italian Super Cup during his two years in charge.
|Valencia: La Liga (2001-02, 2003-04); Uefa Cup (2003-04)|
|Liverpool: Champions League (2004-05); Uefa Super Cup (2005); FA Cup (2005-06); Community Shield (2006)|
|Inter Milan: Supercoppa Italiana (2010); Fifa Club World Cup (2010)|
|Chelsea: Europa League (2012-13)|
|Napoli: Italian Cup (2013-14); Italian Super Cup (2014)|