The Argentine forward was on hand to save the Catalans from defeat with a last-gasp leveler on a wet and windy night in the Basque Country.Barcelona's unbeaten streak extended to 24 matches in all competitions, but the Catalan giants fell further behind fierce rivals Real Madrid at the top of La Liga after being held to a 2-2 draw by Athletic Bilbao at San Mames on Sunday.
The Basques took the early lead with a simply wonderful strike from Ander Herrera, only for Barcelona to peg them back four minutes later when Cesc Fabregas headed home the equalizer.
The rain continued to fall relentlessly, impacting the match in the second half, and Gerard Pique shinned the ball beyond his own goalkeeper to give Athletic the lead with just over 10 minutes remaining.
However, Lionel Messi rescued Barcelona at the death with his first away goal in the league this season to ensure the Catalan giants continued their unbeaten start to the Primera Division campaign.
Pep Guardiola opted to leave David Villa on the bench for the second consecutive match as the champions welcomed back Andres Iniesta and Xavi for the trip to San Mames.
And Xavi combined with Adriano inside the opening five minutes but the Brazilian's effort was held at the second attempt by Athletic keeper Gorka Iraizoz in treacherous conditions.
The opening quarter of an hour passed with neither side able to gain the upper hand in the match until a moment of magic from Herrera.
After 896 minutes of Victor Valdes' goal being impenetrable, Markel Susaeta took advantage of Javier Mascherano's slip to slide the ball across to Herrera. The midfielder took a touch to set himself before expertly curling an effort beyond the Catalan keeper.
Athletic's lead lasted only four minutes before Eric Abidal swung in a beautiful cross to Fabregas, who generated enough pace on his header for the ball to nestle in the top corner.
Neither side was able to dominate possession with both teams surrendering the ball repeatedly as the conditions worsened at San Mames, with the rain falling relentlessly during the interval and it took a defensive error to bring about the game's next goal.
Iker Muniain swung a corner across and after several ricochets in the six-yard box, Pique inadvertently touched the ball beyond Valdes to gift Bilbao the lead with little over 10 minutes remaining.
The Catalan giants went in search of a late equalizer and it came in the 93rd minute, after Fernando Amorebieta had been sent off for a second yellow card, when Messi was on hand to score with a swipe of his left foot, registering his first league goal at San Mames in dramatic circumstances.
Guardiola's side lies three points behind Madrid at the top of La Liga and will hope to return to winning ways when Zaragoza visits Camp Nou following the international break.
Athletic, meanwhile, stretched its unbeaten run to 10 matches and will be full of confidence ahead of its trip to Sevilla, with both sides hunting the Champions League spots.