A dubious injury time Cristiano Ronaldo penalty was enough to move Real Madrid back to within two points of league leaders Barcelona with a 2-1 win away to Elche on Wednesday night.
However, the hosts were left furious with referee Cesar Muniz Fernandez as after failing to show Sergio Ramos a second yellow card for a clear bodycheck on Coro in the first-half, he pointed to the spot in the fourth minute of added time when Pepe fell to the ground under pressure from Carlos Sanchez.
Ronaldo had put the visitors ahead from a free-kick early in the second-half, but Richmond Boakye thought he had rescued a point when he headed home in the 91st minute before the late drama.
With Gareth Bale ruled out with a thigh problem, Real boss Carlo Ancelotti made three changes to the side that started the 4-1 drubbing of Getafe on Sunday as Fabio Coentrao, Ramos and Luka Modric replaced Dani Carvajal, Nacho and Asier Illarramendi.
Ronaldo saw a deflected effort fly just wide in the first minute, but Elche started much the brighter and Real had goalkeeper Diego Lopez to thank to stop them falling behind for the fourth time in six league matches this season.
David Lomban was first to be denied by Lopez as he parried the defender's header from Eduardo Albacar's cross before Carles Gil's low drive was also smothered by the keeper.
Javi Marquez also fired wastefully over as the hosts continued to press and they were rightfully infuriated when Fernandez awarded a foul when Ramos chopped down Coro but didn't show the Spanish international the 18th red card of his career.
Angel di Maria finally forced Elche keeper Manu Herrera into action six minutes before the break, but he was more than equal to the Argentine's volley from a narrow angle and Isco couldn't snaffle up the rebound.
Madrid starting the second period with more purpose and were rewarded just six minutes after the restart when Ronaldo's free-kick bounced just in front of Manu Herrera and he could only help it on its way into the net.
Having gone in front Madrid took their foot off the gas and were finally punished in stoppage time when Elche produced their best move of the match to equalise.
A long ball from Herrera was headed into the path of Fidel and his cross was expertly nodded home at the near post by Boakye.
However, the drama didn't end there as having signalled for there to be three minutes of added time, Fernandez allowed a Madrid corner to be taken well into the 94th minute and then pointed to the spot when Pepe hit the ground.
After a number of Elche players had been booked for protesting, Ronaldo kept his cool and drilled the ball low into the corner to earn his side a precious three points ahead of the Madrid derby with joint leaders Atletico.