The Red Bull driver took the lead for good after the second round of pit stops to beat Hamilton by 0.6 seconds and widen his lead in the standings to 41 points over his McLaren rival.
The German lost use of his KERS power boost and Hamilton tucked in behind him, but Vettel clung to the lead over the final dozen laps, becoming only the fifth winner in 21 races at the Catalunya Circuit who didn’t start on the pole and the first in the last 11 events.
“A lot of people said today wouldn’t be a race — that’s why I’m even more happy we made it,” Vettel said. “The last 10 laps I felt tires going away and I was praying. On top of that sometimes KERS on, sometimes KERS off. It wasn’t an easy race.
“But it was a great result and confirmation we are very strong.”
Michael Schumacher secured sixth for his best finish of the season in front of Mercedes teammate Nico Rosberg, while Nick Heidfeld finished eighth after starting last in the Renault garage. Rookie driver Sergio Perez and Kamui Kobayashi rounded out the top-10 for Sauber.
Perez’s ninth-place finish made him the first Mexican driver to finish in the points in 30 years.
The next race is the Monaco Grand Prix on next Sunday.