Watched by holidaymakers wearing swimsuits and clutching towels on a warm afternoon, Gavazzi outduelled Belgium's Kristof Vandewalle in the coastal resort here for his fourth win of 2011.
France's Alexandre Geniez was third while Spaniard Juan Jose Cobo retained his overall lead.
On a 174km trek through rugged terrain in the northern province of Cantabria, the main contenders eased back letting a 17 rider break go clear.
The 2004 Olympic silver medallist Sergio Paulinho tried a long distance attack that fizzled out three kms from the line, then when Vandewallle zipped away on a slight rise, Gavazzi was the quickest to follow.
"We were worried about Paulinho but fortunately he attacked alone and that didn't work out," Gavazzi told reporters.
"I wasn't too worried about Vandewalle in the sprint, I knew I was fastest."
"I've already had two big wins here in Spain, in the Tour of the Basque Country, it seems like this country brings me luck."
After finishing safely in the main pack in 18th place, Cobo remains in the overall lead for a fourth straight day, with his 13-second lead over Britain's Christopher Froome in tact.
"My team could control the stage well," Cobo told reporters.
"It was pretty straightforward and I didn't feel too nervous. I'm far more worried about tomorrow's stage, it's got a difficult last section and I'm sure Froome will attack there."
Friday's stage from Noja to Bilbao will see the Tour of Spain make its first return to the Basque Country after a 33-year absence.
In its last visit in 1978, separatist protestors barricaded parts of the route and the last stage of the race was cancelled.
The Tour of Spain finishes on Sunday in Madrid.
Results on Thursday from the 18th stage of the Spanish Vuelta, a 176.4km ride from Solares to Noja in the north coast province of Cantabria:
1. Francesco Gavazzi (ITA/LAM) 4h24min 42sec
2. Kristof Vandewalle (BEL/QST) at 0:00.
3. Alexandre Geniez (FRA/SKS) 0:10.
4. Nico Sijmens (BEL/COF) 0:10.
5. Matteo Montaguti (ITA/ALM) 0:10.
6. Volodomir Gustov (UKR/SAX) 0:10.
7. Juan Jose Oroz (ESP/EUS) 0:10.
8. Joaquin Rodriguez (ESP/KAT) 0:10.
9. Robert Kiserlovski (CRO/AST) 0:10.
10. Francis de Greef (BEL/OLO) 0:15.
11. Sergio Paulinho (POR/RSH) 1:08.
12. Martin Kohler (SWI/BMC) 4:03.
13. Josep Jufre (ESP/AST) 4:03.
14. Davide Malacarne (ITA/QST) 4:03.
15. Simon Geschke (GER/SKS) 7:42.
16. Bradley Wiggins (GBR/SKY) 7:42.
17. Daniel Moreno (ESP/KAT) 7:42.
18. Juan Jose Cobo Acebo (ESP/GEO) 7:42.
19. Lloyd Mondory (FRA/ALM) 7:42.
20. Bauke Mollema (NED/RAB) 7:42.
Overall standings (After 18 of 21 stages):
1. Juan Jose Cobo, Spain, Geox, 74 hours, 4 minutes, 5 seconds.
2. Christopher Froome, Britain, Sky, 13 seconds behind.
3. Bradley Wiggins, Britain, Sky, 1:41.
4. Bauke Mollema, Netherlands, Rabobank, 2:05.
5. Denis Menchov, Russia, Geox, 3:48.
6. Maxime Monfort, Belgium, Leopard Trek, 4:13.
7. Vicenzo Nibali, Italy, Liquigas-Cannondale, 4:31.
8. Jurgen Van Den Broeck, Belgium, Omega Pharma Lotto, 4:45.
9. Daniel Moreno, Spain, Katusha, 5:20.
10. Mikel Nieve, Spain, Euskaltel-Euskadi, 5:33.