MADRID (AP)Gonzalo Melero converted a 90th-minute penalty kick as Levante defeated Real Sociedad 2-1 on Friday to keep alive its chances of escaping relegation in the Spanish league.

The victory lifted Levante from last place and left the Valencia club three points from safety ahead of the weekend matches.

The loss hurt Sociedad’s chances of qualifying for the Champions League as it stayed in sixth place, five points behind Atletico Madrid in the fourth and final qualification spot. It was the fourth consecutive winless match for the Basque Country club.

Jorge Miramon opened the scoring for the hosts in the 53rd and David Silva equalized for Sociedad in the 66th.

More AP soccer: https://apnews.com/hub/soccer and https://twitter.com/AP-Sports