Match ends, Villarreal 2, Real Madrid 3.
Real Madrid came from 2-0 down to record a remarkable win at Villarreal, a victory that saw them return to the top of La Liga.
The pivotal moment came at 2-1 when Villarreal's Bruno was adjudged to have handled in the area, although it was disputed if it was intentional.
Cristiano Ronaldo made it 2-2 from the spot after Gareth Bale had headed in Real's first.
Substitute Alvaro Morata then nodded in the winner seven minutes from time.
Real have 55 points, one clear of Barcelona who defeated Atletico Madrid 2-1 earlier on Sunday. Real also have a game in hand over their fierce rivals and over Sevilla, who sit in third with 52 points.
Villarreal stun Real
Coach Fran Escriba's Villarreal went into the match with the tag of 'the meanest defence in the league', having conceded only 15 goals this season.
They lived up to that in the opening half, by barely giving Real a sniff. The closest the visitors came to scoring was when Karim Benzema's header was spectacularly saved by Sergio Asenjo, from point-blank range,
The keeper was substituted having suffered a knee injury in keeping out the France striker's effort. It was later revealed the 27-year-old had suffered cruciate damage.
After the break, Villarreal took a deserved lead when Manu Trigueros fired a half volley past the reach of keeper Keylor Navas. Six minutes later, Real were rocked once more when Congolese forward Cedric Bakambu out-muscled Sergio Ramos to fire in low.
The visitors were staring at defeat.
Real mount fightback & penalty controversy
Los Blancos pulled a goal back in the 64th minute when full-back Dani Carvajal picked out Bale with a great cross.
However, Villarreal still looked comfortable until the 73rd minute when their opponents were awarded a hotly disputed penalty.
Victor Ruiz blocked Toni Kroos' low shot but the ball spun up on to the arm of Bruno Soriano. Referee Gil Manzano thought it was intentional handball and pointed to the spot leading to furious exchanges between Villarreal staff on the touchline and the fourth official. Substitute Roberto Soldado was shown a yellow card for dissent.
Ronaldo fired in the penalty and Real sensed that they could snatch one of their most surprising wins of the season.
With seven minutes of the contest left, Real realised just that when substitute Morata headed in from Marcelo's pinpoint cross.
In the 88th minute, Bale was replaced by Lucas Vazquez moments after he appeared to land awkwardly on his ankle.
The Wales international, who has only just recently returned to action after two months out, did not appear to be in discomfort as he walked off the pitch.
- 1AsenjoSubstituted forFernándezat 35'minutes
- 2Pérez MartínezBooked at 90mins
- 21BrunoBooked at 73mins
- 8J dos Santos
- 19Castillejo Azuaga
- 14Trigueros MuñozSubstituted forRodriat 75'minutes
- 15LópezSubstituted forCheryshevat 57'minutes
- 3PepeBooked at 90mins
- 4RamosBooked at 77mins
- 14CasemiroSubstituted forIscoat 58'minutes
- 11BaleSubstituted forVázquezat 89'minutes
- 9BenzemaSubstituted forMorataat 77'minutes
- 7Cristiano Ronaldo
- Jesús Gil Manzano
- Shots on Target
Second Half ends, Villarreal 2, Real Madrid 3.
Attempt missed. Álvaro Morata (Real Madrid) left footed shot from very close range misses to the left. Assisted by Daniel Carvajal.
Pepe (Real Madrid) is shown the yellow card for a bad foul.
Foul by Pepe (Real Madrid).
Rodri (Villarreal) wins a free kick in the attacking half.
Mario (Villarreal) is shown the yellow card.
Cristiano Ronaldo (Real Madrid) wins a free kick on the left wing.
Foul by Mario (Villarreal).
Attempt missed. Jonathan dos Santos (Villarreal) right footed shot from the centre of the box is close, but misses to the right.
Attempt blocked. Samu Castillejo (Villarreal) header from the centre of the box is blocked. Assisted by Jaume Costa with a cross.
Attempt missed. Sergio Ramos (Real Madrid) header from the centre of the box is just a bit too high. Assisted by Toni Kroos with a cross following a corner.
Substitution, Real Madrid. Lucas Vázquez replaces Gareth Bale because of an injury.
Delay over. They are ready to continue.
Delay in match Gareth Bale (Real Madrid) because of an injury.
Corner, Real Madrid. Conceded by Víctor Ruiz.
Attempt blocked. Cristiano Ronaldo (Real Madrid) right footed shot from outside the box is blocked. Assisted by Gareth Bale.
Goal! Villarreal 2, Real Madrid 3. Álvaro Morata (Real Madrid) header from the centre of the box to the centre of the goal. Assisted by Marcelo with a cross.
Isco (Real Madrid) wins a free kick in the defensive half.
Foul by Rodri (Villarreal).