Oscar Melendo's late goal saw Espanyol snatch a 1-0 win and inflict a first defeat on Barcelona since August, after Lionel Messi failed to score a penalty in the first leg of the Copa del Rey quarter-finals.
A dominant Barca looked as though they would have to settle for a goalless draw after Messi saw his second-half spot kick saved by Diego Lopez on Wednesday, but worse was to come for the Liga frontrunners.
Espanyol caught them on the break late on and youngster Melendo provided a neat finish for his first senior goal, inflicting a first defeat on Barca since their Supercopa de Espana losses to Real Madrid.
Barca were on top from start to finish and created more than enough chances to take a victory back to Camp Nou.
But for all their control, the first half proved particularly frustrating, as clear-cut chances were hard to come by and, when the visitors did manage to craft an opening, the opportunity was wasted or saved.
They should have taken the lead just after the hour mark when Messi stepped up from 12 yards out, but Lopez rescued Espanyol with a brilliant save and Melendo – introduced from the bench – struck two minutes from time to secure an unlikely victory for the home side.
Barcelona did not have much trouble taking control of proceedings early on, as they enjoyed a monopoly on possession.
Chances were by no means a regular occurrence, however, with an eighth-minute Sergio Busquets effort that Lopez did well to parry away being the only opportunity at either end in the first quarter of the match.
Messi eventually burst into life in the 23rd minute and managed to charge through a crowd of players to get a shot away, only for Lopez to make light work of the effort.
At the other end, Barca looked almost too comfortable and such a relaxed approach nearly cost them, as Sergi Roberto gifted possession to Gerard Moreno and the forward fired just wide of the bottom-right corner.
The best chance of the half fell to Denis Suarez just before the break, though, as the midfielder received Messi's pass in the area and shot into the side-netting.
Barca's dominance continued into the second half and a moment of Messi magic forced Lopez into action, as the Argentinian flicked the ball over his head and drilled a volley towards the bottom-right corner from 18 yards, with the goalkeeper getting down to keep it out.
Valverde's frustration brought about the introduction of Ivan Rakitic and Luis Suarez from the bench and soon after the Uruguayan's entrance, Barca won a penalty.
Roberto found his way into the Espanyol area and went down under a clumsy Esteban Granero challenge, but Lopez brilliantly denied Messi's kick, getting down to his left and tipping it wide.
3 - Lionel Messi has missed more penalties than any other La Liga player this season in all competitions (three from six attempts). Strange. pic.twitter.com/rVgz6du5nY— OptaJose (@OptaJose) January 17, 2018
In an incident that will likely result in a sanction for Espanyol, Barca goalkeeper Jasper Cillessen appeared to get caught in the face by something thrown from the stands 13 minutes from the end.
Thankfully he was fine to continue and he made a strong save to push Marco Navarro's fierce free-kick effort over.
But he was helpless a few moments from the end when Melendo latched on to Navarro's well-placed cut-back and steered a cushioned left-footed finish into the bottom-left corner, ending Barca's 29-match unbeaten run.
|Independiente 0 Santos 0: Dogged defending preserves deadlock|
|Ceferin nominated for second term as UEFA president|
|Marseille have ´moved on´ from Balotelli deal|
|´Crazy´ Cheika his own toughest critic|
|McClaren defiant amid QPR woes|
|Lendl joins Zverev´s coaching staff|
|England captain Hartley ready for return|
|Buttler happy to serve up a century as England dig in at Trent Bridge|
|PSV beat BATE in Champions League thriller, Benfica held at home|
|Mkhitaryan backs Emery´s philosophy at Arsenal|
|Championship Review: Leeds go top, QPR problems mount|
|Ronaldo shares snap of ´Juventus family´|
|Aguero is the Premier League´s best foreign import, says Shearer|
|Real Madrid warned they must pay Rodrigo´s €120m release clause|
|England´s Broad fined for Pant rant|
|India on brink of victory after brilliant Bumrah halts Buttler|
|Serena Williams elevated to 17th seed at US Open|
|Kombouare signs new two-year Guingamp contract|
|Scaloni unclear on Messi´s long-term Argentina plans|
|F1 Raceweek: Gasly and Alonso restore focus at Spa|
|Nouri able to communicate, brother reveals|
|Pjanic extends Juventus contract to 2023|
|Odegaard joins Vitesse in latest loan from Real Madrid|
|Luck ´sort of happy´ with sack from Suggs|
|Manchester United´s Sanchez will ´be back soon´|
|Former Giants star Cruz announces retirement|
|RFU set Cipriani disciplinary date despite RPA complaints|
|Spalletti fined €10,000 for ´gravely offensive´ referee comments|
|IndyCar driver Wickens has spinal surgery after Pocono crash|
|Tiger: No doubt this is one of my best years|
|Vice-captain Tiger trying to remain objective in Ryder Cup conversations|
|Ronaldo won´t win Serie A by himself, warns Allan|
|Moeen sends message to England selectors with double century|
|Brunt calls time on Northern Ireland career|
|Tottenham´s Janssen sidelined after foot surgery|
|Liu Xiang breaks women´s 50m backstroke world record at Asian Games|
|Atletico Madrid winger Vitolo suffers knee ligament damage|
|Leverkusen teen Havertz aiming to emulate idol Ozil|
|Beckham to be honoured with UEFA President´s Award|
|CPS drops Hillsborough charges against Bettison|
|Who can take over from Federer, Nadal & Djokovic? Agassi backs Zverev, Kyrgios|
|´Freak incident´ rules Dragons´ Vaughan out for season|
|Kompany: Different Manchester City must not be complacent|
|Toyota withdraw appeal over Alonso´s Silverstone disqualification|
|Manchester City offload defender Denayer to Lyon|
|RPA want RFU to drop Cipriani charge|
|Cheika still the right man for Australia - Polota-Nau|
|Bolt not giving up on Manchester United dream|
|All Blacks must improve ´average´ set-piece, says Smith|
|Raiola hits back at Scholes following Pogba criticism|
|Indians top Red Sox in series opener|
|Struff stuns Cecchinato, Jarry reaches last 16|
|I´ll prove people wrong - Bolt completes first Mariners training session|
|Former champ Kvitova tops Radwanska, Pliskova ousted|
|Sad if it´s Filipe Luis´ last game for Atletico - Oblak|
|White Sox manager Rick Renteria hospitalised before game|
|Carragher: Van Dijk can become Liverpool legend|
|No timetable for Sale return from shoulder injury|
|This is a partnership - Rodgers on contract negotiations with Packers|
|Eagles QB Wentz unsure he´ll be cleared to play opener|
|Balotelli staying at Nice|
|It wasn´t a penalty, says Hodgson as Palace boss fumes at refereeing decisions|
|Salah can play much better - Klopp demands more from Liverpool star|
|Gasly to Red Bull: Vettel, Verstappen and the drivers who took their Toro Rosso chance|
|Klopp in the dark on Karius future amid links to Besiktas|
|Simeone pleased with draw after rigours of Super Cup|
|Captain Reus saves Dortmund in DFB-Pokal|
|I couldn´t care less - Klopp rejects title challenge talk|
|Ailing Bairstow keen to aid England´s unlikely victory bid at Trent Bridge|
|Redskins secure Peterson signing|