The Argentina striker was at hand to save the Catalan giants from their first defeat of the season as los Leones pushed La Liga Champions to the last
Los Leones took the lead with a wonderful strike from Ander Herrera, only for Barcelona to peg them back four minutes later when Cesc Fabregas headed home the equaliser.
The rain continued to fall relentlessly, impacting on the match in the second half, and Gerard Pique shinned the ball beyond his own goalkeeper to give Bilbao the lead with just over ten minutes remaining.
Lionel Messi rescued Barcelona at the death with his first away goal of the season to ensure the Catalan giants continued their unbeaten start.
Pep Guardiola opted to leave David Villa on the bench for the second consecutive match as La Liga Champions welcomed back Andres Iniesta and Xavi for the trip to San Mames.
And club captain Xavi combined with Adriano inside the opening five minutes, but the Brazilian's effort was held at the second attempt by Bilbao's 'keeper in treacherous conditions.
The opening quarter of a hour passed with neither side able to gain a upper hand in the match until a moment of magic from Herrera.
After 898 minutes of Victor Valdes' goal being impenetrable, Markel Susaeta took advantage of Javier Mascheranos' slip to slide the ball across to Herrera. The Spanish midfielder took a touch to set himself before expertly curling an effort beyond the Spanish shot stopper.
Bilbao'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 ten minutes remaining.
The Catalan giants went in search of a late equaliser and it came in the 93rd minute when Messi was on hand to score with a swipe of his left-foot, registering his first goal at San Mames in dramatic circumstances.
Guardiola's side are three points behind Real Madrid at the top of La Liga and will hope to return to winning ways when Zaragoza visit Camp Nou following the international break.
Bilbao, meanwhile, stretched their unbeaten run to ten matches and will be full of confidence ahead of their trip to Sevilla with both sides hunting the Champions League spots.