A 94th-minute goal from Hernan Perez saw Villarreal to the surprise win at Estadio El Madrigal as they edged seven points clear of the relegation zone.

Marcos Senna had earlier cancelled out Santi Cazorla's 65th-minute opener as Malaga, who had goalkeeper Carlos Kameni sent off, missed the chance to jump into third.

Malaga controlled proceedings in the first half but were forced to wait until after the hour-mark to get their opener.

Cazorla powered a low strike into Diego Lopez's bottom corner to give the visitors a deserved lead.

The goal forced Miguel Angel Lotina's men to attack, and they were rewarded when Senna netted from the penalty spot on 83 minutes.

Kameni recklessly brought down Perez in the area and was red-carded, leaving Senna to step up and coolly level from the spot.

The hosts completed their comeback when Perez struck a dramatic late winner, volleying in from outside the area after getting on the end of a poor clearance from substitute goalkeeper Ruben.

Racing Santander remain anchored to the bottom of the table after their 3-0 loss to Mallorca.

Goals from Emilio Nsue, Chori Castro and Alejandro Alfaro guided the visitors to a convincing win, extending Santander's winless run to 14 matches and leaving Alvaro Cervera's side 10 points from safety.

Fellow strugglers Real Zaragoza suffered a 3-0 loss to Sevilla, who had Alvaro Negredo net a brace after Federico Fazio opened the scoring.

Michel's men struck all their goals in the first half and missed several chances after the interval as they jumped to seventh, while Zaragoza stayed second-bottom.