The 38-year-old had finished on the podium a record six times without taking the rainbow jersey which now belongs to him.
After six hours 46 minutes in the saddle, the race on a 258 kilometres mountainous route ended in a four-rider sprint finish as Valverde held off France’s Romain Bardet and Michael Woods of Canada to take gold.
Holland’s Tom Dumoulin was fourth and Italy’s Gianni Moscon fifth.
Valverde, who served a two-year doping suspension for his role in Operacion Puerto earlier in his career, had twice finished second and four times third at the World Championships.
But now Valverde, who rides for Movistar, marshalled the final four and succeeds Peter Sagan of Slovakia as world champion. Sagan had won three successive titles, but was not among the favourites and abandoned the race after three laps.
Peter Kennaugh was the best-placed British rider in 16th place, 1min 21secs behind.
Adam Yates was 37th but his twin brother Simon, who won La Vuelta earlier this month, struggled on the day.
Kennaugh had animated the race and his attack with 22km to go prompted a thrilling finale.
It was not until the brutal 2.9km ascent of Hottinger Holl – included only on the last of seven laps – that the race ignited.
With gradients of up to 28 per cent the climb is nicknamed the ‘Road to Hell’ and a three-man lead group formed.
Dumoulin bridged the gap to Valverde, Bardet and Woods with just over 1km to go, but thought better of an immediate attack, playing into Valverde’s hands.
And the Spaniard used all of his experience to sprint to victory.
“It’s incredible, after missing it for so many years. It’s a victory for the team,” said Valverde.
Commenting on a challenging day for the British riders, Kennaugh said: “That was way harder than expected. It was just raced full gas from the start, even the break took long to go for a World Championships, and then the pace was just really hard for every lap on the climb.
“Unfortunately Simon wasn’t feeling great, so we did what we could. It’s hard without radios to know who is where.
“I was following moves with two to go with the plan we had, but I didn’t know Simon had stopped. In hindsight, I would have just waited, but that’s racing.”
On Saturday, Olympic champion Anna van der Breggen claimed a comfortable victory in the women’s race. The Dutch rider, who won silver in the time-trial, made her move clear of the breakaway group heading into the final 40 kilometres after a climb to take the gold medal with a time of four hours 11 minutes four seconds.
Van der Breggen’s victory margin was some three minutes and 42 seconds ahead of Australian Amanda Spratt. Italian Tatiana Guderzo finished in third place, five minutes and 26 seconds off the impressive gold medal pace of van der Breggen.
Dani Rowe was the leading British rider, finishing in 26th place at 8:18 behind, with Sophie Wright in 41st and Hannah Barnes 45th.