Lionel Messi and Paulinho hit the target as Barcelona crept past Athletic Bilbao to maintain their four-point lead in La Liga.
Messi started and finished a move in the 36th minute to score his 12th league goal of the season, but Barca were flattered by Paulinho's injury-time tap-in after a hard-fought evening at San Mames.
Both sides struck the woodwork, Messi and Paulinho for Barca and Raul Garcia for the hosts, while Marc-Andre ter Stegen made a couple of vital saves to preserve the points.
As well as strengthening his side's grasp on top spot, the result was also Ernesto Valverde's first as a visitor to the club he represented with distinction as player and manager for many years.
Aside from one Messi drive at goal, it was Bilbao who enjoyed the better of the first 20 minutes.
Inigo Lekue and Garcia came together well with a quick one-two, the latter's eventual shot blocked by Samuel Umtiti amid appeals for handball.
Inaki Williams and Aritz Aduriz were next to worry Barca, only for the veteran's soft header to release the pressure.
Aduriz missed an even better chance when Jordi Alba played him on as he went through on goal, blinking first as Ter Stegen stood tall then dropped to save a modest shot.
The visitors replied instantly, Luis Suarez combining with a marauding Messi before the Argentinean skipped round Kepa. A goal seemed a certainty but Messi allowed the angle to get the best of him and sent his shot against the outside of the post.
Remarkably, Messi has now been denied by the woodwork 10 times this season.
That merely proved his warning shot, though, and he made no such mistake when his next chance arrived.
Messi was involved early, feeding Alba from a deep position and charging towards the box. By the time he arrived the ball had too, and a clinical first-time finish was close behind.
Paulinho should have doubled the lead before half-time after Messi's pass, but the midfielder's shot clattered the crossbar.
The frame was shaking again in the 53rd minute, Bilbao unfortunate this time as Garcia rose highest to meet an Ander Iturraspe's corner.
Williams was continuing to cause problems for Barca, using a heady mix of pace and single-mindedness, but his production line of crosses was lacking a willing finisher.
Barca would have been eager to ease the tension with another goal but it refused to come, Unai Nunez making a well-judged sliding block just as Andre Gomes prepared to pull the trigger.
Nunez, who had earlier required treatment after taking an accidental blow to the head, was on hand again when Suarez launched a fierce shot at goal.
Barca were far from water tight at the other end, Inigo Cordoba stretching to reach another Williams ball but not managing to keep his shot down.
Ter Stegan pulled off his best work of the night with five minutes left, showing off stunning reactions to beat Aduriz's header back after he was left unmarked at a corner.
Bilbao were then punished in the final seconds in a Messi-led break. Suarez's shot was parried by Kepa but only as far as Paulinho, who clipped into the unguarded net.