Substitute Nico Gonzalez scored a late winner as Barcelona edged past Elche in La Liga to end their three-game winless run in all competitions.
Ferran Jutgla headed in an opener for the hosts after 16 minutes before 17-year-old Gavi grabbed his first La Liga goal with a superb solo effort.
Substitutes Tete Morente and Pere Milla then stunned the hosts as Elche scored twice in as many minutes to draw level.
But Gonzalez poked into the top corner five minutes from time to win it.
It means Xavi’s side sit seventh, three points off a Champions League spot and 15 behind leaders Real Madrid.
They are now only two points behind fifth-placed champions Atletico Madrid, who lost 2-1 to Sevilla.
Barcelona had failed to win their previous three outings, with a 2-2 draw at Osasuna last Sunday following defeats by Bayern Munich in the Champions League and Real Betis in La Liga.
Jutgla saw an effort ruled out for offside inside 90 seconds but the summer signing did not have to wait long for his first goal at the Nou Camp, heading in Ousmane Dembele’s corner.
The impressive Gavi added a second three minutes later, flicking the ball through his legs on the turn and running directly at the defence before picking out the bottom corner.
But Barcelona momentarily collapsed in the second half, conceding twice in two minutes as first Morente fired into the roof of the net and then Milla headed in at the back post after the hosts gave the ball away.
It was an inspired double change from boss Francisco Rodríguez, who saw the substitutes score within five minutes of being brought on.
Elche looked to have earned a hard-fought point, only for to ball to drop to Gonzalez, who finished smartly to earn Xavi’s young side all three points.
Elche remain 16th, two points above the relegation zone.
Second-placed Sevilla are five points behind leaders Real after beating Atletico.
This is the first time in Diego Simeone’s 10 years in charge that Atletico have lost three La Liga games in a row.
Lucas Ocampos scored the late winner after Thomas Delaney had headed against the bar.
Ivan Rakitic had given Sevilla an early lead, with Felipe equalising for Atleti.
Line-ups
Barcelona
Formation 3-4-3
- 1ter Stegen
- 4Araújo
- 24GarcíaBooked at 79mins
- 15Lenglet
- 5Busquets
- 21de JongSubstituted forPuig Martíat 76′minutes
- 18Alba
- 30Paez Gaviria
- 7Dembélé
- 29JutglàSubstituted forGonzález Iglesiasat 72′minutes
- 33EzzalzouliSubstituted forBalde Martínezat 89′minutes
Substitutes
- 6Puig Martí
- 13Murara Neto
- 14Coutinho
- 17de Jong
- 22Mingueza
- 23Umtiti
- 26Peña Sotorres
- 28González Iglesias
- 31Balde Martínez
- 34Sanz
- 38Jaime
Elche
Formation 4-4-2
- 13Badia
- 14Palacios Zapata
- 3RocoBooked at 86mins
- 4González
- 22MojicaSubstituted forSánchez Guillénat 83′minutes
- 17Ferrández PomaresSubstituted forMorente Olivaat 45′minutes
- 23MarconeSubstituted forGumbauat 45′minutesBooked at 77mins
- 21MascarellSubstituted forGutiérrez Parejoat 60′minutes
- 16Chaves de la TorreSubstituted forMillaat 59′minutesBooked at 71mins
- 12Pérez
- 9Boyé
Substitutes
- 2Gumbau
- 7Carrillo
- 8Gutiérrez Parejo
- 10Milla
- 11Morente Oliva
- 15Pastore
- 19Barragán
- 20Piatti
- 24Sánchez Guillén
- 25Werner
- 26Donald
- 33Carmona Álamo
- Referee:
- Javier Alberola Rojas
- Attendance:
- 41,664
Live Text
-
Match ends, Barcelona 3, Elche 2.
-
Second Half ends, Barcelona 3, Elche 2.
-
Attempt missed. Jordi Alba (Barcelona) left footed shot from long range on the left misses to the right from a direct free kick.
-
Jordi Alba (Barcelona) wins a free kick on the left wing.
-
Foul by Raúl Guti (Elche).
-
Riqui Puig (Barcelona) wins a free kick in the attacking half.
-
Foul by Raúl Guti (Elche).
-
Gavi (Barcelona) wins a free kick on the left wing.
-
Foul by Enzo Roco (Elche).
-
Substitution, Barcelona. Balde replaces Abdessamad Ezzalzouli.
-
Sergio Busquets (Barcelona) wins a free kick in the attacking half.
-
Foul by Lucas Boyé (Elche).
-
Enzo Roco (Elche) is shown the yellow card.
-
Goal! Barcelona 3, Elche 2. Nicolás González Iglesias (Barcelona) right footed shot from the centre of the box to the top left corner. Assisted by Gavi.
-
Ousmane Dembélé (Barcelona) wins a free kick in the defensive half.
-
Foul by Helibelton Palacios (Elche).
-
Substitution, Elche. Josema replaces Johan Mojica because of an injury.
-
Eric García (Barcelona) is shown the yellow card for a bad foul.
-
Foul by Eric García (Barcelona).
-
Lucas Pérez (Elche) wins a free kick on the left wing.