After a goalless opening half hour normal service appeared to have been resumed when Lionel Messi scored a few minutes before half-time.
And when Ivan Rakitic made it 2-0 just after the hour mark, it seemed unthinkable that Barcelona would do anything other than run away with the match.
Yet Lucas pulled one back for Depor with 13 minutes left to go, and Álex Bergantiños then added the second three minutes before the final whistle to complete a remarkable comeback – just as Depor did against Barcelona last season.
“It is difficult to explain it,” midfielder Andres Iniesta told reporters.
“We lost control when we needed to keep it and made it easy for the opposition at 2-0.
“These things happen and we will analyse it and try and make sure it doesn’t happen again.”
Luis Enrique’s men dominated possession with 68 per cent of the ball, but Depor had plenty of chances on the break and even saw one effort come back off the woodwork.
Barcelona remain top on 35 points, but Atletico Madrid will have a chance to catch them if they can beat Athletic Bilbao at home on Sunday evening, while Real Madrid will be able to pull up to two points off the top should they win at Villarreal.
Injured Neymar was missing from Barca’s ruthless attacking trident and so the door was opened for youngster Sandro Ramirez.
Barca were up against a tactically strong Deportivo, who have one defeat in 12 matches, and their game plan was not to sit too deep but have players forward to take advantage of counter-attacks.
Luis Suarez missed a golden chance early on, firing just wide after being set up by a Sandro header and generally Barca had plenty of the ball but found little space.
Lucas had a shot blocked from close range at the other end before a piece of Messi brilliance gave Barca the lead.
Barca continued to probe but it took another special effort from Rakitic to breach the Depor defence again.
The Catalan side appeared on course for victory but they lost composure at the back allowing in Lucas for his 11th league goal, and then Bergantinos was given space to strike the ball home past keeper Claudio Bravo.