Chasing a record fifth consecutive triumph, Barca were undone by a relentless and gutsy Valencia side, who hung on after Lionel Messi pulled a goal back to set up a dramatic finish in Seville.
By then, Valencia were already two up, Kevin Gameiro and Rodrigo scoring twice in 13 frantic first-half minutes, after the latter spurned a golden early chance that could have spared them a nerve-shredding last 17 minutes.
Messi drove the comeback effort and Goncalo Guedes twice should have wrapped it up for Valencia, missing a one-on-one and then an open goal before the final whistle sparked pandemonium.
Valencia’s coach Marcelino, who might have been sacked when his team were four points off relegation in January, raced around the pitch in a frenzy. Barcelona’s players sank to their knees.
Messi admitted on Friday his team had still not recovered from the “hard blow” suffered against Liverpool and certainly they seemed too easily disheartened here, finding their fight only once it was too late.
Messi also threw his support behind Barcelona’s coach Ernesto Valverde but it remains to be seen whether the backing of the board remains after two dreadful defeats have now spoiled such a brilliant La Liga campaign.
They came here as favourites, but only just, their 1,457 consecutive days as Copa del Rey champions under threat, from their own sense of deflation, key players out injured and Valencia’s recent surge.
If Barca’s season all but ended three weeks ago, Valencia’s arguably found life a few days later, as they moved into the top four for the first time and then held on to qualify for the Champions League.
Winning their first trophy since 2008, in the club’s centenary year, completes a remarkable comeback year that, after 15 games, had them languishing in 15th.
Antonio Banderas wins Cannes ‘best actor’
Some saw a metaphor in Barcelona’s pre-match tifo, spelling out ‘All Together’ splitting down the middle, while there were key absentees from their starting line-up too, Marc-Andre ter Stegen, Luis Suarez and Ousmane Dembele all injured.
Valencia should have been ahead within five minutes, Clement Lenglet’s error sending Rodrigo clear but his finish was brilliantly scooped off the line by the recovering Gerard Pique.
Barca, with Sergio Busquets in the centre of a back three, settled but lacked zip and in the 23rd minute they were behind. Jose Gaya scuttled in behind Nelson Semedo and his pull-back wrong-footed everyone except Gameiro, who fired in.
Semedo had been beaten down the left and soon after Jordi Alba was outrun down the right, by Carlos Soler, whose cross needed only to be nodded down and in by Rodrigo for number two.