MADRID — Lionel Messi missed a penalty and Barcelona conceded late as its 29-match unbeaten streak ended in a 1-0 loss to city rival Espanyol in the first leg of their Copa del Rey quarterfinal on Wednesday.
Messi failed from the spot in the 62nd minute, his shot brilliantly saved by goalkeeper Diego Lopez. Youngster Oscar Melendo netted the winner for the hosts in the 88th with his first goal as a professional.
"I have no words, I was looking forward to this first goal," said the 20-year-old Melendo, who had come on as a substitute in the second half.
It was Espanyol's first win against Barcelona at its RCDE Stadium.
The second leg of the Catalan derby is next week at Camp Nou.
Barcelona hadn't lost since a 2-0 defeat by Real Madrid in the second leg of the Spanish Super Cup on Aug. 16. It had won 23 of its last 29 matches in all competitions.
"We knew we would lose one day," Barcelona midfielder Sergio Busquets said. "The positive thing is that in a week we have a chance to rebound and advance."
Messi had his chance from the spot after Sergi Roberto was fouled by Esteban Granero, but his low shot into the right corner was stopped as Diego Lopez dived to his left to tip the ball away.
It was a rare miss for Messi, who is having a stellar season and is the Spanish league's top scorer with 17 goals.
"The penalty save gave us the boost that we needed," Melendo said. "We were playing too defensively."
Melendo netted the winner with a low shot from the middle of the area after a well-timed pass by Marc Navarro.
Barcelona coach Ernesto Valverde did not use all of the team's regular starters, leaving players such as Luis Suarez on the bench.
The match was interrupted for a few minutes in the 76th after Barcelona goalkeeper Jasper Cillessen was hit by an object thrown by fans behind his goal.
Barcelona midfielder Paulinho was replaced in the second half because of a foot injury.
SEVILLA STRIKES FIRST
Sevilla scored two late goals to come from behind and beat Atletico Madrid 2-1 in the first leg of their quarterfinal.
Diego Costa gave Atletico the lead in the 73rd but the visitors equalized with an own-goal by Atletico goalkeeper Miguel Angel Moya in the 80th and secured the victory with a strike by Joaquin Correa after a breakaway in the 88th.
Atletico was debuting its attacking trio of Costa, Antoine Griezmann and Victor "Vitolo" Machin, a former Sevilla player, but they were not able to get the job done in an entertaining match in which both teams created many scoring chances at the Wanda Metropolitano Stadium.
"It was an open match, but they capitalized on their chances," Atletico coach Diego Simeone said. "They deserved the victory."
The result ended Atletico's four-game winning run.
Sevilla is enduring a five-game winless streak in La Liga but had won both games against second-division Cadiz in the Round of 16 of the Copa del Rey.
Police said an Atletico fan in his early 20s was hospitalized in a serious but stable condition before the match after being stabbed in a fight near a metro station in the stadium area.
VALENCIA ALSO RALLIES
Valencia also scored two late goals in a 2-1 come-from-behind victory over 10-man Alaves.
Ruben Sobrino put the visitors ahead with a strike from outside the area into the top corner in the 66th, but Valencia equalized seven minutes later with Goncalo Guedes. His angled shot deflected off a defender and goalkeeper Antonio Sivera was unable to recover in time to make the save.
Alaves played a man down from the 77th after defender Adrian Dieguez was sent off with a second yellow card.
Forward Rodrigo scored the winner from close range, firing a shot that hit the post before going in.
More AP Spanish soccer coverage: https://apnews.com/tag/LaLiga
Tales Azzoni on Twitter: http://twitter.com/tazzoni