Two Antoine Griezmann goals had twice given Barca the lead at La Cartuja. The Frenchman opened the scoring with a clever finish from inside the box and restored Barca's advantage in the 77th minute after Oscar de Marcos' equaliser just before the break.
Barca were minutes away from winning their first trophy under coach Ronald Koeman when Asier Villalibre turned home a 90th free kick to make it 2-2 and take the tie into an additional 30 minutes.
Inaki Williams' stunning strike in the 94th minute sentenced the game, with Messi seeing red for the first-ever time as a Barca player for taking a swipe at Villalibre in the final minute as frustration boiled over.
Griezmann's goals should give him confidence after a difficult season, although the fact they counted for nothing in the end will hurt. Other than that, young defender Ronald Araujo was impressive again.
The worst thing about missing out on a first piece of silverware this season -- and their first since 2018-19 under Ernesto Valverde -- is that Barca have been put through 240 minutes for the pleasure of it. After extra-time against Real Sociedad in midweek, the last thing they needed was extra-time again against Athletic in an already congested season, especially as it didn't end with the first trophy of the Koeman era.
You have to wonder how Messi, a doubt until the last minute with an injury, will recover from the effort particularly.
Elsewhere, defending is a problem. There are too many concentration lapses in defence, especially from Jordi Alba and Clement Lenglet. A run of nine games without defeat has helped Barca slowly turn their season around but this was a wake-up call: they still have a long way to go.
Manager rating out of 10
5 -- Koeman took Ousmane Dembele and Pedri off just before Villalibre's last-minute leveller and Barca never looked the same team again. Athletic were deserving winners, with their new coach Marcelino winning the tactical battle.
Player ratings (1-10; 10 = best. Players introduced after 70 minutes get no rating)
GK Marc-Andre ter Stegen, 6 -- Could do little about any of the goals.
DF Sergino Dest, 6 -- Only lasted until half-time after failing to fully recover from a thigh injury.
DF Ronald Araujo, 7 -- Good in the air and quick across the ground, he dealt with the threat and speed of Williams well throughout.
DF Clement Lenglet, 5 -- Was walking a tightrope from the moment he was booked for fouling Williams in the first half. His positioning was poor for Villalibre's goal.
DF Jordi Alba, 5 -- Helped set up both Barca goals but also defended both Athletic goals poorly. Let De Marcos in behind him for the first and ducked out of the way of the free kick that led to the second.
MF Sergio Busquets, 6 -- Did OK. Was well positioned once again and snuffed out a few Athletic attacks.
MF Frenkie de Jong, 7 -- Tried to drive forward with the ball but lacked support in the final third.
MF Pedri, 6 -- Athletic took much better care of him this time after being torn apart by him at San Mames just 10 days ago.
FW Ousmane Dembele, 6 -- Got into a couple of promising positions and was always a threat with his acceleration, but was lacking an end product.
FW Antoine Griezmann, 8 -- Took his goals well and worked hard, especially in defence.
FW Lionel Messi, 5 -- Rushed back from an injury to start the game but didn't look fit. His frustration, with himself and his team's performance, bubbled over late on as picked up a rare red card.
DF Oscar Mingueza, 6 -- Replaced Dest at the break but had a difficult time against the impressive Iker Muniain, who was everywhere.
MF Miralem Pjanic, N/R -- Had more minutes than he bargained for, coming on to see the game out after Griezmann's goal and then getting an extra 30.
FW Martin Braithwaite, N/R -- Wasn't the threat Barca needed when they were chasing the game.
MF Riqui Puig, N/R -- Came on in extra-time and demanded the ball but didn't produce anything of note this time after his penalty heroics in midweek.