Celta proved to be a thorn in the Catalans side all match, starting from early on when Borja Iglesias struck just three minutes after Ferran Torres' 12th-minute opener to re-level the score.
Against the run of play, the visitors would take an unlikely lead after Iglesias completed his hat-trick with strikes in the 52nd and 62nd minutes.
Barca hit back immediately with goals from Dani Olmo (64') and Raphinha's first of the game in the 68th minute to bring things back to level pegging.
The hosts continued to push for a goal but had to wait until eight minutes into stoppage time at the end of the game before they were awarded a penalty, which Raphinha converted - much to the relief of the Barcelona faithful.
Elsewhere in LaLiga on Saturday, Mallorca and Leganes played out to a drab 0-0 draw while Javier Munoz's dramatic 93rd-minute strike was enough to hand Las Palmas a surprise 1-0 win over Atletico Madrid.
Marash Kumbilla scored the only goal of the game in the 39th minute and Christantus Uche was sent off as Espanyol beat 10-man Getafe 1-0 and a Cesar Tarrega own goal in the 45th minute meant Valencia would have to settle for a 1-1 draw with Rayo Vallecano after Umar Sadiq scored the leveller in the 75th minute.