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.
|Warriors´ Iguodala to miss game six against Rockets|
|I shouldn´t have done it – Ronaldo accepts future comments mistimed|
|Klopp: Liverpool behind Karius after Champions League horror show|
|Karius´ final blunders could destroy his career – Kahn|
|Zidane understands Bale frustration|
|Bale, Karius send Twitter into overdrive in action-packed Champions League final|
|Ronaldo: It should be called the CR7 Champions League|
|Zidane revels in Madrid´s third successive Champions League title|
|I lost Liverpool the game – Karius apologises for Champions League errors|
|Barcelona congratulate Champions League winners Real Madrid|
|Salah injury update: Egyptian FA calm World Cup fears|
|Ronaldo must stay with Madrid - Zidane|
|Champions League final player ratings: Bale stars as Karius shocker costs Liverpool|
|Cristiano is happy and will continue to be happy – Perez cools Ronaldo future talk|
|Win as a team, lose as a team - Liverpool captain Henderson not blaming Karius|
|Modric: Madrid have built dynasty like Bulls, Celtics and Lakers|
|Where would Cristiano go? - Benzema predicts Ronaldo stays at Madrid|
|We do not think about that - Zidane shrugs off Ronaldo exit talk|
|The divine right of kings: Zidane´s Real Madrid ride luck all the way to greatness|
|Klopp fears Salah will miss World Cup|
|Du Plessis returns, 17 uncapped players selected by South Africa|
|Bale demands playing time after Champions League heroics|
|Ramos: Ronaldo is indispensable to Real Madrid|
|It´s been beautiful to play for Real Madrid - Ronaldo hints at shock exit|
|Salah injury marked beginning of the end for Liverpool|
|Bale double makes Champions League history|
|Bale, Mandzukic & the best Champions League final goals|
|Real Madrid 3 Liverpool 1: Brilliant Bale undoes Klopp and calamity Karius|
|Jokanovic proud Fulham stuck to style in Wembley win|
|Real Madrid´s Carvajal limps out of final to prompt Spain fears|
|Broughton and Catalans continue fine form|
|Tearful Salah off injured in Champions League final|
|Leinster complete historic double by beating Scarlets|
|Lions snatch win from Stormers, Brumbies stun Bulls|
|Bale sits out warm-up ahead of Champions League final|
|Cavaliers´ Kevin Love ruled out of game seven|
|Pavlyuchenkova saves two match points to win Strasbourg epic|
|Benzema comparisons have made me stronger, says Giroud|
|Pakistan´s victory charge frustrated by Buttler and Bess|
|Aston Villa 0 Fulham 1: Cairney secures Premier League return|
|Isco preferred to Bale in Champions League final|
|Castres hold off Racing to book Top 14 final berth|
|McIlroy recovers late to share Wentworth lead with Molinari|
|Mancini perfect for new-look Italy, says Baselli|
|F1 Raceweek: Ricciardo set to vanquish Monaco demons|
|Goretzka confident over World Cup fitness|
|No pain, just cramp - Farrell allays injury fears|
|Sri Lanka to work with ICC after pitch-doctoring reports|
|Champions League Diary: Madrid fan´s brass act, Liverpool lap it up|
|FIFA dampens Platini´s ban reversal hopes|
|Germany unsure over Boateng´s full-training return date|
|Wyles bows out in style as Saracens regain Premiership crown|
|Fucsovics brushes aside Gojowczyk to claim first ATP crown|
|Not in my lifetime - Shilton will ´never forgive´ Maradona|
|Gutsy Thiem clinches Lyon title to build Roland Garros momentum|
|Martinez accuses Real Sociedad of blocking Manchester City move|
|LeBron focused on treatment, sleep ahead of game seven|
|Froome felt in control despite ´brutal´ Giro|
|Nadal to face lucky loser Bolelli after Dolgopolov withdrawal|
|Iniesta welcomed by thousands of fans at Vissel Kobe presentation|
|Monaco crash a ´brutal lesson´ for Verstappen|
|Ricciardo seals Monaco pole as Verstappen misses qualifying|
|Neuer will not be a World Cup back-up - Low|
|Froome on the brink of history with Giro glory all-but secure|
|No reward for Riske as Larsson claims Nuremberg Cup|
|Andreolli expects ´extraordinary motivator´ Emery to succeed at Arsenal|
|Verstappen misses Q1 after FP3 crash|
|Griezmann ´a gift´ at €100m, says Dugarry|
|Highlanders grind down Reds, Chiefs hold off Waratahs|
|Injured Bacsinszky pulls out of French Open|