Rafael Benitez has confirmed he will leave Napoli at the end of the season after two years in charge.
The Spanish coach has been linked with Real Madrid, who parted company with coach Carlo Ancelotti on Monday.
Madrid-born Benitez spoke in a press conference alongside Napoli president Aurelio De Laurentiis, and said: "My contract with Napoli was a two-year deal. A contract that will end on Sunday after the game against Lazio.
"I want to thank the club, its president and the fans for what you have done for me.
"I want to say goodbye to this club and I want to end my cycle here with a victory and a place in the qualifying round of the Champions League."
Benitez, who began his coaching career with Real Madrid's B team, has been away from Spain since 2004, when he left Valencia to take the helm at Liverpool.
"The first thing is the distance from my family," the 55-year-old said.
Benitez considered remaining for a third year at Napoli, however.
"A few weeks ago I spoke to my wife to try to convince her, but then I told (Napoli president) Aurelio (De Laurentiis) that it would not have been an easy task," he said.
"He had to look ahead and so did I, we will try to win until the end."
Napoli won the Coppa Italia under Benitez in his first season but the current campaign got off to a rocky start when the club lost to Athletic Bilbao in the qualifying stages for the Champions League.
The Naples outfit still have a chance to achieve a top-three finish with a victory at home to Lazio on Sunday night and that would put them back into the Champions League qualifying round.
Benitez has been one of the biggest coaching names in football for more than a decade as he led Valencia to two Primera Division titles, back-to-back appearances in the Champions League final and a UEFA Cup crown.
He also steered Liverpool to Champions League glory in 2005, where his team staged a major comeback in the final to stun an Ancelotti-led AC Milan.
Benitez also won the FA Cup and UEFA Super Cup while at Liverpool.
The veteran has never been short of work opportunities.
He coached Inter Milan in 2010 but was sacked three months into the Serie A season.
Benitez also led Chelsea to the Europa League title in the 2012/13 campaign before joining Napoli.
De Laurentiis is not surprised that Benitez is leaving.
"Rafa told me immediately after he agreed to stay on last summer that this would be his last campaign because his family wanted him nearby," he said. "I want to thank Rafa, a coach that I really wanted two years ago."
Real Madrid president Florentino Perez announced the club will appoint a new coach next week and that the priority would be to hire a Spanish-speaking manager.
Landing Real's top job would be the biggest challenge of Benitez's career.