Barcelona s Spanish defender Jordi Alba celebrates scoring a goal during the Spanish league football match between FC Barcelona and CA Osasuna at the Camp Nou stadium in Barcelona on May 2, 2023. Photo: AFP
Xavi Hernandez's side climbed 14 points clear of second place Real Madrid, who visit Real Sociedad later on.
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.
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.
The visitors might have been reduced to nine men as goalkeeper Aitor Fernandez collided with Raphinha outside the area as the Brazilian burst through, but the referee decided both players were to blame.
Ronald Araujo powered a header narrowly over the bar from Raphinha's corner, while the Brazilian whipped a free-kick onto the roof of the net.
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.
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 and when he did get a chance, Fernandez foiled him too.
Ferran Torres almost scored when he deflected a clearance narrowly wide of the far post, with Osasuna clinging on by their fingertips.
When Lewandowski found the net with 10 minutes remaining 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.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)