MADRID — Celta Vigo took advantage of its breakaway chances in the second half to stun Real Madrid 2-1 in the first leg of the quarterfinals of the Copa del Rey on Wednesday, handing Zinedine Zidane's team its second consecutive defeat after a record run of 40 games unbeaten.

Iago Aspas netted off a counterattack in the 64th minute and set up Jonny Castro's goal after another break in the 70th, one minute after Marcelo had equalized for the hosts at Santiago Bernabeu Stadium.

Celta, which eliminated Atletico Madrid at this stage of last year's tournament, needs a draw to advance in next week's second leg in Vigo. Even a 1-0 loss would be enough at the Balaidos Stadium.

"We will need to play even better in Vigo because we are facing a great rival that will make it very difficult for us," Celta coach Eduardo Berizzo said. "No result is safe against a team like Madrid."

It was the fifth win in a row for Celta, and the second loss for Madrid since setting the Spanish record for most consecutive games without a defeat in all competitions. It had lost by the same score at Sevilla in the Spanish league on Sunday to see its streak end.

Before then, Madrid hadn't lost since a Champions League game at Wolfsburg in April, and its only other defeat last year was at home against Atletico Madrid in the Spanish league.

"I'm not worried," Madrid coach Zinedine Zidane said. "It's a difficult moment because of the consecutive losses, but we know we can overcome this. We are behind but we can still change that in the return match."

Real Madrid hadn't lost at home in the Copa del Rey in five years, since a 2-1 defeat against Barcelona in the quarterfinals of the 2012 tournament.

Aspas opened the scoring after a great run by Theo Bongonda through the left flank. Marcelo used his back heel to try to clear Bongonda's cross, but the ball stayed inside the area and Aspas picked it up to score from near the penalty spot.

Marcelo equalized just five minutes later with a volley from inside the area after a ball that was partially cleared by the defence.

But Aspas found Castro in between defenders for Celta's second goal with a shot from the edge of the box as goalkeeper Kiko Casilla charged from the net to try to make the save.

Karim Benzema had Madrid's best chance to equalize after coming off the bench in the second half, but his close-range shot in the 83rd minute went over the crossbar. Cristiano Ronaldo had few chances despite playing from the start.

Celta was eliminated by Sevilla in last season's semifinals. Madrid, which was disqualified in the opening round last season for fielding an ineligible player, is seeking its first title since 2014.

In other first leg matches on Thursday, two-time defending champion Barcelona plays at Real Sociedad, while Atletico hosts Eibar.

___

ALCORCON 0, ALAVES 2

Forward Ibai Gomez scored twice late to give Alaves a two-goal lead heading into next week's second leg at home.

Gomez broke the deadlock in the 90th minute and added another goal in stoppage time to secure the advantage for the recently promoted club.

Alcorcon, the only second-division club still alive in the competition, had defender Carlos Bellvis sent off with a straight red card moments after Alaves opened the scoring at Santo Domingo Stadium.

___

Tales Azzoni on Twitter: http://twitter.com/tazzoni