Sevilla beat basement club Leganes 1-0 at home in an enthralling encounter on Sunday to climb up to second in La Liga.
The win lifted them to 30 points after 15 games, one behind leaders Real Madrid, who have a game in hand, although Barcelona, on 31 points, climbed back above both sides when they beat Atletico Madrid later on Sunday.
Sevilla defender Diego Carlos struck the only goal in the 63rd minute of an end-to-end game, blasting into the roof of the net from close range inside a crowded penalty box after Jules Kounde's overhead kick was parried.
Even though they are still propping up the table, Leganes have made huge improvements under Mexican coach Javier Aguirre and last week came close to causing a shock against Barcelona, eventually losing 2-1.
They produced a gutsy and bold display in Seville and created numerous chances to score throughout the game, with Moroccan forward Youssef En-Nesyri almost giving them the lead with a vicious bicycle kick early in the second half.
They laid siege to Sevilla's area in added time but Julen Lopetegui's side clung on, surviving nervy final seconds when a VAR review took place to determine whether the visitors should be awarded a penalty for pushing in the box.
The result stretched Sevilla's unbeaten run to 10 games in all competitions, of which they have won eight, but Lopetegui was not pleased with how his side performed.
"We can't kid ourselves, we need to improve a lot," Lopetegui told reporters. "We should have tried to keep playing attractive football and we would have created more chances, but sometimes you play badly and win and play well but you lose.
"Things got very tough for us in the second half, we made mistakes and lost control, and after we scored we couldn't stay calm. We didn't want to end the game playing as we did but sometimes it's what you have to do."