United States defender Oguchi Onyewu scored three minutes into injury time to secure Malaga a 1-1 draw at third-division Eibar in the first leg of their Copa del Rey last-16 match on Tuesday.
Onyewu jumped above two Eibar players to head a last-gasp free kick over Eibar goalkeeper Jon Altamira, who had unwisely rushed off this line.
Eibar, which eliminated Athletic Bilbao in the previous round, had gone ahead in the 74th with a goal from defender Txemi Anibarro.
The second leg will be played in Malaga on Jan. 8.
The winner moves on to face either Barcelona or Cordoba in the quarterfinals. Barcelona won 2-0 at Cordoba in the opening leg.