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.
|Klopp fined £45,000 referee comments|
|Mourinho to analyse Clasico for beIN SPORTS|
|Ronaldo has won three Champions Leagues, not five – Atletico president Cerezo hits back at Juventus|
|Greatest Wales side ever? Not in my book, says Gatland|
|FA charge Millwall over racist chanting|
|Saiss signs new Wolves deal|
|Klopp impressed by Solskjaer´s ´brilliant job´ at United|
|De Jong excited to join ´greatest ever´ Messi at Barca|
|Gattuso ´not building anything´ at AC Milan|
|Manchester City fan in critical condition after alleged assault following Schalke game|
|Kovac wants repeat of Bayern´s defensive efforts|
|Semenya sets record straight over government funding for IAAF case|
|Tottenham´s Kane to be assessed ahead of Burnley clash|
|McIlroy to skip Irish Open|
|England rest Stokes and Buttler for Windies T20s|
|Lambert given two-game touchline ban after East Anglian derby fracas|
|Gatland puts faith in Anscombe to face England|
|PSG terminate Diarra contract|
|Nantes grant Cardiff extension over Sala payment, Warnock confirms|
|Horne replaces Russell for injury-hit Scotland in Paris|
|Eriksen´s agent ignoring transfer speculation|
|Moon and Nowell to start for England against Wales|
|PSG announce new shirt sponsor|
|Hearn expects Joshua-Usyk fight in 2020|
|Van Dijk wants to be a ´legend of Liverpool´|
|India lose Pandya for Australia T20s and ODIs|
|KNVB postpones Ajax game to boost Real Madrid preparations|
|Tigers land Rabbitohs flyer Jennings|
|Man United have new flow under Solskjaer - Wijnaldum|
|Manchester United v Liverpool: Herrera the unsung hero of resurgence|
|Manchester United v Liverpool: Alexander-Arnold gets chance to show growth at Old Trafford|
|Duke players, Coach K react to Zion Williamson’s knee injury|
|Barack Obama wishes Zion Williamson a ´speedy recovery´|
|CONCACAF Champions League Review: Santos Laguna hit Marathon for six|
|Morgan praises Root, Roy after record chase|
|LeBron sends best wishes to top NBA prospect Zion Williamson after injury|
|Schwartzman the latest seed to fall in Rio|
|Duke star Williamson suffers knee injury|
|Koke: VAR will give Morata a goal one day|
|´Everybody wants to actually talk about bull****´ – Irving angry over Durant video rumours|
|Ronaldo had a good game – Allegri backs Juventus star|
|We weren´t at our best – Tuchel after PSG´s 5-1 rout|
|LeBron James ready for Lakers´ playoff push|
|Allegri: Juventus not dead yet|
|Ronaldo: I´ve won five Champions Leagues, Atletico have zero|
|Machado picking Padres over White Sox might´ve been a mistake – Anderson|
|LaLiga dismisses Tebas to Premier League links|
|Simeone apologises for crotch-clutching celebration|
|Roy, Root star as England complete record run chase|
|City boss Guardiola defends VAR after confusion reigns at Schalke|
|Sterling: Schalke win shows where City are heading|
|PSG star Neymar heads to Brazil for treatment|
|Guardiola: City ´not ready´ to win Champions League despite beating Schalke|
|Paris Saint-Germain 5 Montpellier 1: Di Maria hits screamer as champions cruise|
|Schalke 2 Manchester City 3: 10-man visitors strike late through Sane & Sterling|
|Atletico Madrid 2 Juventus 0: Advantage Atleti after late double|
|Derby County 0 Millwall 1: Wallace dents Rams´ promotion hopes|
|Tsitsipas eases past Hurkacz in Marseille opener|
|Van Uytvanck makes winning start to Budapest defence|
|Tiger Woods feeling fresh as Masters moves into view|
|Southampton secure youngster Obafemi to new contract|
|Joel Embiid struggling with knee injury|
|Halep growing in confidence as Dubai quarters are finalised|
|Le´Veon Bell won´t be hit with Steelers´ franchise tag|
|Khedira thanks fans for support following discovery of heart problem|
|Maximum! West Indies break record for number of sixes in an ODI innings|
|Karunaratne eyes history in Port Elizabeth|
|Rayo facing rap after Atletico fans display alleged racist flags|
|Kvyat snatches top spot as Williams finally return|
|Plaudits premature, says Milan star Piatek|