Cristiano Ronaldo scored two goals in a three-minute span to give 10-man Real Madrid a 4-3 win over Real Sociedad on Sunday, after coach Jose Mourinho's decision to drop goalkeeper Iker Casillas almost backfired for a second straight game.
Despite heavy criticism after last round's loss, Mourinho again started rarely used Antonio Adan, but the keeper was sent off after giving away an early penalty.
Ronaldo scored on the break in the 68th before hitting the winner from a free kick in the 70th. But Prieto wasn't done and scored his hat trick in the 76th to keep the wild shootout in doubt until the final whistle.
Madrid's first victory in three games left it in third place, 13 points behind leader Barcelona and four points behind Atletico Madrid before their games later.
The crowd at Santiago Bernabeu stadium voiced its displeasure with Mourinho's continued benching of Casillas by jeering the coach's name when it was announced before the game and cheering for their beloved star.
Madrid's fans, however, couldn't have asked for a better start just two minutes in when Sociedad's unbalanced defense left Benzema unmarked to receive Khedira's pass and slot beyond the stranded Claudio Bravo.
But Madrid's lead didn't last long when Mourinho's choice in goal again proved misguided.
Adan was overwhelmed last round when he conceded three goals in the loss at Malaga, and he was soon shown to be out of his depths at home as well.
The regular backup made a poor pass that Carlos Vela intercepted, and he then charged out and tackled the Mexico forward in his box.
The referee didn't hesitate to show him a direct red card, creating the dramatic situation of Casillas being called off the bench to defend the penalty try.
The crowd chanted "Iker! Iker!" as the Spanish international jogged on, but there were no heroics as Prieto coolly stroked in the spot kick to equalize in the ninth.
Despite being short a man, Madrid pressed forward and deservedly went in front in the 35th through Khedira's crafty back-heeled flip to redirect a cross between the posts.
Prieto beat Casillas to restore parity at 2-2 five minutes later when he pounced on a rebound inside the area.
But Ronaldo gave Madrid control of the match when Benzema stole the ball in midfield and played the Portugal winger behind the defense for him to score.
Ronaldo then earned a free kick on the left corner of the area and blasted the ball over goalkeeper Claudio Bravo for his 16th goal in the league this season.
Madrid striker Gonzalo Higuain went on as a substitute for his first action since being sidelined for two months with a leg injury and quickly found the woodwork.
Prieto appeared to give Sociedad a late hope when he shot inside the far post, but Sociedad never threatened again after Daniel Estrada was booked for a second time, leaving the visitors with 10 men for the final 10 minutes.
Information from The Associated Press was used in this report.