Shakhtar Donetsk pushed Barcelona all the way before substitute Pedro scored a 115th minute winner to secure the Uefa Super Cup for Josep Guardiola's side.
The European champions controlled possession throughout, but summer signing Zlatan Ibrahimovic failed to impress against the defence-orientated Ukraine outfit.
Long after Thierry Henry and Ibrahimovic had departed it was down to the substitutes to prevent the match at Monaco's Stade Louis II stadium going to a penalty shoot-out.
That moment arrived just five minutes before the end of extra-time when Pedro played a delightful one-two with the impressive Lionel Messi before curling a right-footed effort inside the far post.
Barca were far from their free-flowing best and credit must be paid to Shakhtar for maintaining their shape throughout. It might have been a different story had they taken one of their rare half-chances.
Even without the injured Andres Iniesta, Barcelona still dominated against an unadventurous Shakhtar side packed with hard-running Ukrainians and only mildly spiced up by their four Brazilians.
Shakhtar did not create a single opening in normal time while Barca at least showed some intent.
HungryHenry looked hungry and he was the first to threaten, a trademark dipped shoulder confusing his marker before he struck a rising shot which whistled over the crossbar.
Dmytro Chygrynsky, playing his last game for Shakhtar before joining Barca, gave the ball away to Messi and then went in hard on the diminutive Argentinian to regain possession.
A quick free-kick from Xavi saw Messi sting the fingers of Andriy Pyatov in the Shakhtar goal and the keeper recovered quickly to deny the lurking Henry.
Barcelona claimed for a penalty after Messi's direct free-kick struck Olexandr Kucher's arm but the referee was unimpressed.
If the first half had been disappointing, there was little to lift spirits in the second.
Daniel Alves produced a hopeless blast into the stands and then Ibrahimovic produced his major contribution to the game, falling like a sniper victim under Olexiy Gai's challenge and bringing a yellow card for the defender.
With the game drifting towards unwanted extra-time, Barcelona tried to step up a gear.
Turned it over
Messi hit a fierce left-foot effort that Pyatov could only parry, and when the ball drifted out to Henry by the left touchline he took deliberate aim to loop a shot into the far corner but the Shakhtar keeper climbed just high enough to turn it over.
Ibrahimovic continued to frustrate, failing to pass to Henry when he was clean through and then collapsing in the area theatrically under a fair challenge.
Messi lit up the match with a Maradona-like dribble past four challenges only to be thwarted at the very last moment. Furious, he became involved in a pushing match with Kucher and both were booked.
In the 98th minute Victor Valdes made his first save, diving low to keep out Julius Aghahowa's goal-bound shot.
Bojan, on for Henry, could have wrapped it up with two chances before, having barely threatened, the Ukrainians were denied a blatant penalty when Ilsinho was felled.
Shakhtar coach Mircea Luscescu stormed onto the pitch in fury but it was all in vain as Messi's brilliant pass set up Pedro for the latest of winners.
Pedro pens new Barca dealMLS All-Stars edged by Everton in PKs