Jordi Alba came on as a super-sub to deliver Barcelona's only clutch goal against 10-man Osasuna on Tuesday, sending the Catalans a step closer to their first La Liga title since 2019.
Xavi Hernandez's side climbed 14 points clear of second place Real Madrid, who lost 2-0 at Real Sociedad.
The visitors had debutant Jorge Herrando sent off in the first half for a professional foul on Pedri, as they sat deep and tried to frustrate hosts Barcelona.
Visiting goalkeeper Aitor Fernandez kept the leaders at bay in the second half but eventually substitute Alba, who has had reduced minutes this season, sliced home a volley to snatch a late victory.
"We're going to wait and see, but it's a giant step forward," said Xavi.
"We suffered too much. We missed some very clear chances, the kind where you can just push it in.
"And then came Jordi's goal, which sometimes makes it better to win like that."
Osasuna coach Jagoba Arrasate rotated heavily to rest players ahead of the Copa del Rey final against Madrid on Saturday, while Barca started with the same side which crushed Real Betis at the weekend.
The Catalans failed to carve out many clear opportunities in the first half against their defensive opponents.
The best chance fell to Pedri after left back Alejandro Balde found him a few yards out from goal but he did not connect with the ball well, scuffing a shot wide.
Osasuna were reduced to 10 men before the half-hour mark when Herrando pulled down Pedri as he ran in on goal.
Xavi brought on Ansu Fati after 35 minutes for Gavi, who appeared to take a knock, and the forward came close at the start of the second half but Fernandez denied him.
String of saves
Frenkie de Jong should have sent Barcelona ahead but fired straight at the goalkeeper from six yards out when Pedri found him.
Barcelona's frustration grew when Fernandez saved from Fati again and substitute Ousmane Dembele sent a shot wide from close range.
La Liga's top scorer Robert Lewandowski had another quiet night at the office. When the Polish forward did find the net it was ruled out for offside.
Eventually, the breakthrough came with five minutes to go, with substitute Alba volleying home his second goal of the season after De Jong headed the ball into his path, sparking vigorous celebrations.
If Barcelona earn two more points from their last five games, they will be champions.
Madrid beaten
Former Madrid winger Takefusa Kubo and Ander Barrenetxea netted the goals for Real Sociedad against Los Blancos, tightening their grip on the fourth spot and Champions League qualification.
Madrid defender Dani Carvajal was sent off after an hour for a second yellow card to make matters worse for Los Blancos, who face Osasuna in the Copa del Rey final on Saturday.
"It's not the best way to prepare for games," said Madrid coach Carlo Ancelotti.
"A defeat always hurts, it lowers your dynamic, the good feelings, so it's not the best way to prepare for what's to come.
"In the players' heads obviously is more, the Copa final, the Champions League semi-finals, that has an effect.
"When you don't have good concentration, you end up giving away gifts."
The Italian played a makeshift side because of injuries and suspensions, and he also left striker Karim Benzema behind in the Madrid capital ahead of Saturday's cup finale.
Kubo struck at the start of the second half for the hosts after Eder Militao gave the ball away in a dangerous area.
Carvajal was dismissed for a foul on Real Sociedad forward Mikel Oyarzabal, giving Madrid an uphill struggle.
Madrid goalkeeper Thibaut Courtois did well to parry a deflected Barrenetxea strike, but he could not keep out the forward's next effort, surprising the Belgian at his near post.
If third-place Atletico Madrid beat Cadiz on Wednesday, they can move second.
Real Sociedad are eight points clear of fifth-place Villarreal, who have played one fewer game.
Bottom-of-the-table Elche were relegated after a 2-1 defeat at Almeria.