This is not the first time Manuel Pellegrini has been on the verge of walking away from Málaga. The Chilean, who had reportedly agreed a deal to replace Roberto Mancini at Manchester City even before their FA Cup final defeat, admitted that he had his bags packed ready to go on 31 October of last year. He had just broken a promise – not to the club, but to his players – and he considered it the honourable thing to do, a gesture of defiance and dignity.

It was less than a week since Málaga had defeated seven-times winners Milan in their first Champions League campaign; it was also the day the players had been promised that they would get the wages they had been waiting for. Pellegrini had promised them too, having mediated between the squad and the club. But the deadline came and went and Pellegrini decided that he would too. Or, at least, that is what he wanted them to think. Pellegrini continued and the payment was met. But just as Santi Cazorla had left in the summer, Nacho Monreal departed during the winter window – the moment, Pellegrini said this week, that symbolised that his side could no longer really compete for a Champions League place which, because of a Uefa ban, they may not have been allowed to occupy anyway.

Málaga won their group, beat Porto and were seconds and an offside goal away from the semi-final. But they lost against Borussia Dortmund, the side who then hammered Real Madrid 4-1.

And that, in a nutshell, is Malaga's season; a brief portrait of why Pellegrini might want to walk away and why Txiki Begiristain, City's director of football, may want to have him succeed Mancini. The last debutant Champions League team to reach the last eight was Villarreal in 2006. Their coach? Manuel Pellegrini. A penalty miss from Juan Román Riquelme proved decisive as Arsenal reached the final instead.

Málaga were supposed to be Spain's other big club when they were taken over by Sheikh Abdullah al-Thani. They spent almost €60m in the summer of 2011, the same summer that they brought in Pellegrini. But midway through the season, something shifted. Thani lost interest and the money dried up. Players went unpaid and results began to slip away. But, bit by bit, Pellegrini created a virtue out of the crisis.

Málaga qualified for the Champions League but there was silence from the club, uncertainty: there were formal complaints, players, teams and the taxman demanding the settling of unpaid accounts. Thani disappeared and when those left behind at the club began to restructure, knowing that there would be no more cash coming in, they had little choice but to sell, cutting costs at every turn to satisfy their debts.

Pellegrini insisted that selling Cazorla to Arsenal for €20m would be giving him away; Málaga sold him for less. Solomón Rondón, Joris Mathijsen and Ruud van Nistelrooy went too. Seeing which way the wind was blowing, other players sought to follow but Pellegrini intervened, convincing them that it was worth hanging on. The Champions League was a unique opportunity. "He prevented a mass exodus," says one player.

Even without the player he had made his priority signing on arriving – he had worked with Cazorla at Villarreal –Málaga were recognisably a Pellegrini team. Villarreal were in only their third season in the first division when Pellegrini arrived, taking them to eighth, third, seventh, fifth and runners-up, playing tidy, creative football. There have been seven managers in the four years since he left. And a relegation.

When he arrived at Málaga Pellegrini outlined his ideas to World Soccer: "to be attacking, to try to take control of the game, to take responsibility, to be attractive. There are small differences of course, depending on what players you have, but there is a footballing concept and a concept of spectacle that is non‑negotiable."

Like Villarreal, Málaga wanted possession, playing out from deep and pushing high to win the ball. Their wide men, interiores rather than exteriores, came inside to create a numerical advantage in the middle of the pitch. In the absence of Cazorla, players at opposite ends of their careers, Isco and Joaquín, took on greater creative responsibility: both have been superb. Every training session is based around the ball and Pellegrini listens to his players. Yet those who have worked with him suggest that he is far tougher than his elegant, well-mannered public persona suggests.

Málaga appeared the idyllic escape after a difficult year at Real Madrid. Signed by Real's director general Jorge Valdano, Pellegrini immediately found a president, Florentino Pérez, who never really wanted him and both Arjen Robben and Wesley Sneijder were sold without his consent.

Pellegrini's team finished on 96 points but still behind Barcelona. Worse, Madrid were knocked out of the Champions League by Lyon and hammered 4-0 by Second Division B side Alcorcón in the Copa del Rey. At the end of the season, the open secret was confirmed: he was pushed out for José Mourinho.

Málaga were supposed to be different: like Villarreal, only with more money. Expensive but sensible signings, a balanced squad, stability; players, as Pellegrini himself insisted, "with human qualities as well as footballing ones", who could help the club to grow, to be ambitious; the construction of a new academy and real belief in the players coming through. The coach was adamant: "this is not just a six-month project or a one-year project," he said.

It turned out to be exactly that. Pellegrini kept it going for another year and momentarily it looked like they may even have a chance of winning the Champions League, Pellegrini's first trophy in Europe. The financial problems had been pushed aside, for the time being at least.

The night that Málaga defeated Milan, Joaquín said: "Without Pellegrini this might never have happened. It's not just about the fact that we're winning but how we're playing. Everyone knows Pellegrini's philosophy and his history but he's a guy who gives you so much confidence, who acts with so much humility that, somehow, he always gets the best out of every player: he is the central piece in this jigsaw."

But the night that they were defeated by Dortmund, everything unravelled. Including Pellegrini himself: no longer so decorous, just days after his father had died, recently off a plane from the funeral in Chile, he accused Uefa of not wanting a banned team in the semi-final. Deep down, though, he knows that there are reasons for the ban. He and his players have suffered them, after all.

He told his players that, this time, they should not wait for him. The promises no longer ring true. They have been broken too often. This week he publicly reiterated the fact that this not the project he came for.

On Wednesday one member of the squad admitted that "many players will go in the summer". Pellegrini will lead them out. In October, he stayed. This time he will not. "It is a strange situation," he said on Friday. "No one wants to leave, we all want to stay. But circumstances do not allow that."