When Girona were on the verge of losing for just a second time this season, the surprise package of the Spanish league turned to their ageing all-time leading goalscorer to pull out a victory that keeps them on top of the standings.
Veteran striker Cristhian Stuani came off the bench to rally Girona past Valencia 2-1 on Saturday (Sunday AEDT) to keep the team from north-east Spain in the thick of the title race.
The win kept Girona level on points with Real Madrid, who eased to a 2-0 win over relegation-threatened Granada at home.
The 37-year-old Stuani started the stunning comeback at Girona's Montilivi Stadium with a goal in the 82nd minute from a cross by fellow substitute Yan Couto.
Girona then took the lead in the 88th when another cross by Couto intended for Stuani appeared to be turned into the goal by Valencia defender Cristhian Mosquera.
The league website credited Stuani with the goal, but he said he believed it was an own goal.
"The team showed their pride in this victory," Stuani said. "We are living a dream, fighting right up there at the top, and we will give it our all to stay there."
The former Uruguay striker joined Girona from Middlesbrough in 2017.
He has become Girona's all-time top scorer -- up to 121 goals -- and fan favourite after helping them return to the first division in 2022.
As he has aged, Stuani has become a valuable weapon off the bench, especially thanks to his knack for scoring from crosses. He has five goals in this campaign.
"We made a mistake that made the game an uphill battle, but we threw everything we had into the game and it worked thanks to Stuani, who was great," Girona coach Michel Sanchez said.
"Stu is the smartest player in the area. When we put the ball in the box, he always appears. I am happy for him. He is the most loved player in Girona."
Ninth-placed Valencia took the lead against the flow of play when Hugo Duro capitalised on a defensive error in the 56th.
Duro broke free when he ran onto a pass that Girona defender David Lopez had unwisely let roll past him before chipping goalkeeper Paulo Gazzaniga.
Girona are partly owned by Manchester City's Abu Dhabi ownership, but their salary cap for players is only the 13th biggest in the 20-team league, with the list topped by Madrid at 727 million euros ($A1.2 billion).
Outclassed by the hosts, Granada never gave Madrid goalie Andriy Lunin any work.
Toni Kroos threaded a pass through Granada's packed area for Brahim Diaz to open the scoring in the 26th, with Rodrigo doubling the lead in the 57th by scoring in a fifth consecutive game.
The game marked the debut of Granada's new coach, the Uruguayan Alexander Medina, who replaced Paco Lopez.
Elsewhere, Athletic Bilbao routed Rayo Vallecano 4-0 with the final goal coming from Spain winger Nico Williams, who signed a new contract with the Basque club through 2027 on Friday.
Umar Sadiq scored from outside the area to equalise for Real Sociedad in their 1-1 draw at Osasuna. Sociedad stayed in sixth.
Australian Associated Press