Barca took the lead in the 40th minute when Antoine Griezmann drilled home after Lionel Messi's shot was blocked.
Then in a blink of an eye, Oscar de Marcos snuck behind the Barca defenders to score the equalizer.
The Catalan Giants then went ahead in the 77th minute, once again through Griezmann.
But Bilbao were not accepting defeat as they responded in the dying moments with Asier Villa-libre stabbing in on a cross to force the game into extra time.
And the decisive moment emerged three minutes into added time when Inaki Williams cut inside and curled the ball into the top-right corner to win the trophy for his side.