Barcelona climbed to second in La Liga after teenage winger Lamine Yamal’s superb late winner gave them a 1-0 victory at home to Mallorca.
The visitors looked set to frustrate Barca, for whom Ilkay Gundogan had a 24th-minute penalty saved.
Yamal, 16, then struck the crossbar early in the second half but curled in a fine effort from just inside the box.
Barca are now within five points of leaders Real Madrid, who host Celta Vigo on Sunday.
They are eight matches unbeaten in all competitions, a run which has put them two points above Girona before they host Osasuna on Saturday.
Barca, whose coach Xavi was serving a touchline suspension, made a positive start before winger Raphinha was clipped in the box by defender Jose Manuel Copete.
Summer signing Gundogan stepped up to take his second penalty for Barca but the Germany midfielder’s side-footed effort was saved by Serbia goalkeeper Predrag Rajkovic low to his left.
After Yamal hit the woodwork with a fierce, curling strike, Marc Guiu was denied by Rajkovic and Barca brought on Vitor Roque and Robert Lewandowski just past the hour mark.
Roque spurned a great chance as he headed over but Lamal then exchanged passes with Lewandowski just outside the box before taking on his man and working enough space to get away a crisp strike which curled beyond Rajkovic inside the far post.
It was a sixth goal of the season for Lamal, who became Barca and Spain’s youngest goalscorer earlier in the season, and his first since scoring twice in the 3-3 draw at home to Granada last month.