Barcelona's quest for a top-four finish took a huge step forwards on Thursday as Xavi's men saw off fellow European hopefuls Real Sociedad.
The Catalan side were on top in the first half and good value for their lead, which came through Pierre-Emerick Aubameyang's header, but they took their foot off the gas after half-time and had Marc-Andre ter Stegen to thank for preserving their lead.
Barcelona were a little fortunate not to go behind early on. Some nervy play around the back saw Alexander Isak press Ter Stegen into a real dilemma, but his clearance hit the Swede and went narrowly wide.
Just a few minutes later, the visitors were celebrating as Aubameyang headed home from a few yards out. An excellent passing move led to Ousmane Dembele hitting the post, but Gavi recycled possession and found Ferran Torres, whose lobbed pass put it on a plate for Aubameyang.
Things got a bit scrappy after that and Barcelona's next real chance wouldn't come for another 20 minutes. It was Frenkie de Jong who came close, side-footing an effort from the edge of the box that wasn't far away at all.
Chances were especially tough to come by for Sociedad. Alexander Sorloth had an opportunity from a cross but his header wasn't particularly tough for Ter Stegen to deal with.
Before the first half was up, Torres and Aubameyang both came close to adding a second goal, but each ended up firing wide, and Barcelona were nearly made to pay for their profligacy as Isak spurned a fantastic chance to equalise shortly before the break. The young striker went through one on one, but could only drag his effort wide.
Within minutes of the second half beginning, Sorloth missed a sitter. Adnan Januzaj's cross found him at the back post but the Norway international couldn't control his strike and sent it flying wide.
Sorloth came calling again shortly before the hour mark, drawing an impressive stop from Ter Stegen to protect Barcelona's lead. The visitors were holding on for a while as La Real took control of the game, dominating possession and asking real questions of Xavi's men.
Januzaj sent in another dangerous cross which went all the way through a crowded box and again needed a reflex save from Ter Stegen as it looked destined for the side netting.
Barcelona slowly started to grow into the second period and with 17 minutes to go, they had their first real chance. This time, it was Gavi who found some space in the box, but the young midfielder couldn't control his effort and sent it wide.
The visitors managed to hold on and secure a huge three points, but they really paid the price for it. Ronald Araujo, Gerard Pique and Dani Alves all went off injured, while Jordi Alba played through a nasty knock for the entire second half.
Barcelona are back up to second now, with a six-point cushion and a game in hand boosting their top-four cause.
Barcelona player ratings vs Real Sociedad
1. Barcelona (4-3-3)
GK: Marc-Andre ter Stegen - 8/10 - A nervy moment early on but recovered well. Made an excellent save to deny Sorloth and rose to every challenge that came his way.
RB: Dani Alves - 5/10 - A tricky one. Played more as an inverted midfielder and did a good job of helping spray balls around the pitch, but left Dembele to fend for himself out on the right and was usually out of position when his defenders needed an option. Not sure this tactic was the right one. Limped off through injury.
CB: Ronald Araujo - 7/10 - Struggled without Alves' help on the defensive end but everything he could control was incredible. A real issue for Sociedad before injury forced him off early in the second.
CB: Gerard Pique - 7/10 - His leadership made a massive difference but Pique picked up an early injury which limited his involvement.
LB: Jordi Alba - 5/10 - Offered very little going forwards and just as shaky at the back. Fortunate that Isak can't hit a barn door these days.
DM: Sergio Busquets - 7/10 - Offered some nice control in the midfield battle. Shielded his defence well.
CM: Frenkie de Jong - 7/10 - Ran the show for Barcelona. Given a lot of responsibility in Pedri's absence and didn't let Xavi down.
CM: Gavi - 6/10 - Some excellent energy in midfield and his pressing was really impressive, although his passing wasn't always accurate. Great work rate for the opener.
RW: Ousmane Dembele - 6/10 - A real danger on the ball but his shooting just wasn't good enough.
ST: Pierre-Emerick Aubameyang - 7/10 - A routine strike to open the scoring but guilty of being a little wasteful at times.
LW: Ferran Torres - 5/10 - Got the assist for Aubameyang's opener but that was pretty much the only positive impact he had.
SUB: Eric Garcia (54' for Araujo) - 5/10 - Barcelona's performance fell off when Garcia came on.
SUB: Sergino Dest (64' for Alves) - 6/10 - Offered more alongside Dembele.
SUB: Luuk de Jong (82' for Aubameyang) - N/A
SUB: Clement Lenglet (82' for Pique) - N/A