Gerard Pique got 10-man Barcelona out of jail as their 100 per cent start to the season was ended by battling Girona.
Barca looked to be cruising when Lionel Messi's eighth goal of the campaign gave them an early lead, but defender Clement Lenglet's 35th-minute dismissal was compounded by Cristhian Stuani's equaliser before the break.
Stuani doubled his tally six minutes into the second half as the visitors threatened to pull off a major shock in the Catalan derby, but central defender Pique clinched a 2-2 draw which sent his side back to the top of the LaLiga table on goal difference with a 63rd-minute header.
The visitors, buoyed by back to back victories, started brightly and might have taken the lead with just five minutes gone when defender Bernardo Espinosa found himself unmarked in the box, but planted his header firmly into the arms of keeper Marc-Andre ter Stegen.
However, Barca slipped quickly into gear and it took a fingertip save from Girona goalkeeper Yassine Bounou to repel Messi's shot after he had skipped past three men as he cut across the face of the penalty area.
But there was nothing the keeper could do to deny the Argentina international when Arturo Vidal laid a 19th-minute ball into his path and saw him sweep a shot past Bounou to open the scoring.
Bounou prevented Luis Suarez from increasing the lead after Messi had expertly picked out the Uruguayan, but the visitors were almost back in it with 29 minutes gone when striker Cristian Portu rounded Ter Stegen, only for Pique to clear his effort off the line.
Barca were dealt a blow 10 minutes before the break when referee Gil Manzano, with the aid of the video assistant referee, dismissed Lenglet for an elbow on Riera Pere Pons and they were made to pay on the stroke of half-time.
Stuani managed to get between Pique and emergency central defender Sergio Busquets and his control was excellent as he set himself to beat Ter Stegen.
Barca boss Ernesto Valverde moved to strengthen his rearguard at the break when he sent on Samuel Umtiti and withdrew midfielder Ousmane Dembele.
But the Nou Camp was stunned into silence within six minutes of the restart when, after Ter Stegen had blocked Portu's shot, Stuani rammed the rebound into the empty net.
Valverde's response was to introduce Ivan Rakitic and Philippe Coutinho in place of Arthur and Vidal, but it was Messi who very nearly dragged the home side back into it with a curling 60th-minute free-kick which rattled the crossbar with Bounou beaten.
Barcelona were level within three minutes when Suarez got to Messi's cross ahead of Bounou and saw his shot loop up off the keeper for Pique to head home.
Girona found themselves under the cosh as time ran dow,n with Umtiti seeing an 80th-minute attempt blocked and Coutinho testing Bounou from distance, but they managed to hang on to claim a point.
ga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});
ga('pacontentapi.set', 'referrer', location.origin);
ga('pacontentapi.set', 'dimension1', 'By Press Association Sport Staff');
ga('pacontentapi.set', 'dimension2', '476b1789-1fd8-44ce-bdbe-dd1419413150');
ga('pacontentapi.set', 'dimension3', 'paservice:sport,paservice:sport:football,paservice:sport:match-reports,paservice:sport:uk,paservice:sport:world');
ga('pacontentapi.set', 'dimension6', 'story');
ga('pacontentapi.set', 'dimension7', 'composite');
ga('pacontentapi.set', 'dimension8', null);
ga('pacontentapi.set', 'dimension9', 'sport:football');
ga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Pique saves Barca\u2019s blushes as Girona threaten derby upset'});