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 was facing the sack when his team were four points off relegation in January, raced around the pitch in a frenzy. Barcelona's players sank to their knees.
"We always had faith," said Marcelino. "Beating Barcelona to win the cup is very special. We deserved to win."