Messi, in his 753rd appearance for Barca, swung at Asier Villalibre in the final seconds of extra time – an incident spotted by the VAR.
Barca led twice through Antoine Griezmann but Oscar de Marcos and Villalibre, in the final minute, scored as Athletic replied each time.
Inaki Williams scored a fine winner.
The game in Seville was set to be remembered as an entertaining encounter and for Athletic’s second trophy since 1985, until the late drama.
Messi lashed out at goalscorer Villalibre off the ball in the 120th minute. The referee missed the clash at the time before viewing it on the VAR screen and dismissing Messi.
The 33-year-old had only been sent off twice before, both for Argentina – on his international debut against Hungary in 2005 and in the 2019 Copa America third-place play-off against Chile.
He could now be banned for at least four domestic games, with Super Cup suspensions carrying over to league and cup matches.
Barcelona were seconds away from winning the Super Cup for a 14th time – in what would have been a first trophy under Ronald Koeman’s reign. It would also have been an eighth Super Cup for Messi, in what could be his final season at Barca with his contract coming to an end this summer.
Griezmann put them ahead after Messi’s shot was blocked before De Marcos scored from Williams’ cross moments later.
Athletic’s Raul Garcia had a header disallowed by the VAR and then Griezmann converted from Jordi Alba’s cross.
But in the final minute substitute Villalibre volleyed home to force extra time. Williams’ excellent winner soon after the restart came as he got the ball on the edge of the box and curled into the top corner.
Athletic, who beat Real Madrid 2-1 in the semi-finals, have beaten Real and Barca in consecutive games for the first time since 1960.
The defeat comes just as Barca – who needed penalties to beat Real Sociedad in the semis – and their captain were finding form. It was a first defeat in 10 games for the Catalan side, while it ends Messi’s run of four goals in two games and six in five.