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.
|I play for France´s biggest club – Marseille star Payet fires barb at PSG|
|Clippers owner says team traded Griffin for ´chemistry´ reasons|
|Ben Stokes returns to face New Zealand in opening ODI|
|Main priority was to win - Spalletti praises Inter´s ´heart´ after beating Benevento|
|Verdasco to meet Schwartzman in Rio Open final|
|Father fuels Conte´s fire ahead of Mourinho reunion|
|Tiger Woods shoots first sub-70 round since 2015|
|Valverde steers clear of Barcelona yellow card controversy|
|Montpellier pull clear of Racing in Top 14|
|Connacht bring Benetton back to earth|
|Butler suffers meniscus injury but Timberwolves ease ACL fears|
|Play like it´s a friendly - Guardiola reveals finals secret ahead of Arsenal clash|
|Barcelona equal record for unbeaten LaLiga run|
|Jones fronts up after Scotland smash England|
|Wales disappoint Gatland: We were the creators of our own demise|
|Inter 2 Benevento 0: Nerazzurri pick up much-needed win at San Siro|
|Barcelona 6 Girona 1: Suarez treble and Messi masterclass settle Catalan clash|
|Messi makes Girona 36th LaLiga victims to set new record|
|Nigeria demolish Rwanda in FIBA qualifying|
|Jonker shines but India still seal T20 series|
|Deeney ´not bothered´ after ending drought from open play|
|Tigers back to business after Hardaker departure|
|Championship Review: Fulham beat Wolves, Sunderland hold Boro in ill-tempered thriller|
|Lions bounce back to win, Schoeman leaves it late for Bulls|
|Russell eyes Six Nations title after inspiring Scotland to win over England|
|Watford 1 Everton 0: Stunning Deeney finish moves hosts six clear of trouble|
|Benitez rues missed chances as Newcastle lose two-goal lead|
|Heynckes ´can live´ with home Bayern draw|
|Ronaldo is a team player - Zidane hails Real Madrid star´s Benzema gesture|
|West Ham fans reference Hitler in protest at club´s owners|
|Dyche dismayed by decisions before Gabbiadini goal|
|Russell´s redemption comes as Scotland seal rare England win|
|Wagner impressed with Huddersfield´s commitment after vital win|
|No place like home for Schmidt as Ireland leave it late to sink Wales|
|Liverpool win had everything – Klopp enthuses over West Ham´s Anfield rout|
|Khachanov sets up Pouille final after Berdych upset|
|Dunk equals record for own goals in a single Premier League season|
|Chiefs return to winning ways in thriller|
|Real Madrid 4 Alaves 0: Ronaldo at the double as ´BBC´ delight|
|Burnley 1 Southampton 1: Gabbiadini grabs late leveller|
|Brighton and Hove Albion 4 Swansea City 1: Two-goal Murray helps end Swans´ unbeaten run|
|Bournemouth 2 Newcastle United 2: Hosts in thrilling fightback after Gayle double|
|West Brom 1 Huddersfield Town 2: Van La Parra and Mounie seal vital win|
|Liverpool 4 West Ham 1: Salah nets again as Reds climb to second|
|Svitolina retains Dubai crown as Kasatkina runs out of steam|
|Ill Neymar included in PSG squad for Le Classique|
|Bayern Munich 0 Hertha Berlin 0: Lewandowski´s run ends as leaders are held at home|
|Ireland see off Wales in Dublin thriller to stay perfect|
|Gattuso surprised by AC Milan´s growth since taking over|
|Lambert defends ´best goalkeeper in Britain´ Butland after own goal error|
|Stokes expected to face Black Caps|
|Mkhitaryan, Ozil potential excites Mertesacker|
|A-League Review: Perth Glory in dramatic win, Melbourne Victory end losing streak|
|Leicester City 1 Stoke City 1: Butland howler costs Potters|
|Matic insists Man Utd can still do ´big things´|
|Fisher´s birdie streak secures share of Qatar Masters lead|
|Chinese Super League transfer window makes Simeone ´uncomfortable´|
|Ingolstadt score bizarre tap-in after Duisburg goalkeeper goes AWOL|
|Allegri cautious over Dybala fitness despite Higuain injury|
|Napoli´s Zielinski better than De Bruyne, claims Boniek|
|Seven-try Crusaders beat Chiefs, Waratahs and Brumbies win|
|Mourinho predicts ´amazing´ period for Manchester United|
|Mears expects ´good England win´ at Murrayfield|
|Barcelona midfielder Rafinha hoping to seal permanent Inter move|
|EFL Cup final: Where do Aguero and Aubameyang rank among Europe´s elite?|
|Klaasen and Mulder get Proteas Test call to face Australia|
|Settled Salah demands Champions League qualification for Liverpool|
|England not polished article - Shaw|
|Dembele staying focused after ´genius´ praise from Pochettino|
|Spain survive scare, USA cruise in World Cup qualifying|