Malaga have confirmed that Manuel Pellegrini will not be in charge of the club next season.
The Chilean has been heavily linked with the vacant managerial position at Manchester City, after they sacked Roberto Mancini.
Pellegrini led the Spanish side to the quarter-final of the Champions League this season, while they are currently sixth in the Primera Division.
However he has left for "sporting reasons" with two years left on his contract.
Pellegrini said on the club's official website.
"Everyone has the right and obligation to follow his path and Malaga has to take another. The club has the need and the obligation to have a realistic project.
"Malaga has a story without Manuel Pellegrini, and (is) also going to have a future without Manuel Pellegrini.
"(I have) an eternal gratitude to the club's owners, who trusted me blindly.
Pellegrini confirmed he was leaving La Rosaleda earlier today.
"My coaching staff and I have separated from Malaga but our union with this city will be eternal," he said.
"We had a time with the club that was very rewarding. Everyone has the right to move on.
"Sunday will be my last match at La Rosaleda and will be very exciting for me.
"Sunday will be my last match at La Rosaleda and will be very exciting for me," - Manuel Pellegrini.
"I'm not leaving due to the matter of money but looking for a project that allows me to develop my profession conveniently."
The most convenient project could well be at City, who have been seeking a new boss since Mancini's departure earlier this month.
Pellegrini's name was being linked with the Blues before the Italian's exit on May 13, although the Chilean denied a deal had already been done following the goalless draw with Sevilla on May 12.
"I deny here and now being the new coach of Manchester City, I haven't signed any agreement with anybody," Pellegrini said on his club's official website at the time.
"I've been fortunate enough, and very proud, that every year the big clubs have shown an interest in me.
"I have an agreement with Malaga not to talk to anyone and nothing has been agreed with any other club.
"I hope in the coming weeks that things will become a little clearer about what is going to be the future here at this club."
That clarity has now been provided and comes on the day that UEFA confirmed Malaga had had the second year of their European ban for unpaid bills lifted.
The Qatari-owned club had been handed a two-year ban from European competition, with one year suspended, and fined 300,000 euros (#256,954) but the suspended year has now been chalked off.
The first year will still stand, however, meaning the club will not compete in Europe next season should they qualify and that appears to have had a bearing on Pellegrini's decision.
Malaga seem certain to finish in the Europa League places as they sit five points clear of eighth-placed Rayo Vallecano with two games left to play.
"I'm going for sporting reasons," Pellegrini continued. "We leave the club qualified for Europe with the mission accomplished but it is unfortunate that this project changed."
Pellegrini first moved to Europe in 2004 when he became boss of Villarreal.
In five years with the Yellow Submarine he guided the club to unprecedented success, reaching the Champions League semi-finals in 2006 and finishing second in the league in 2008.
That attracted the attentions of Madrid and Pellegrini moved to the Bernabeu in 2009 but was sacked after a single season, following a second-placed finish in the league and last-16 exit in the Champions League.
He moved to Malaga in November 2010 and guided the club to 11th before finishing fourth in his first full season in charge.
His side exited the Champions League at the quarter-final stage to Borussia Dortmund this season and will finish their season with games against Deportivo La Coruna and champions Barcelona.