It's the Italian's second stage win at this year's race, after he took the spoils on stage 13 of the race during the second week.
The profile of the route looked to give a final chance to the sprinters before the race reaches Milan on Sunday, but a short climb around 7km or so from the finish was always going to produce attacks from the puncheurs of the bunch.
Tom-Jelte Slagter (Cannondale-Garmin) was the first to make a move at about 5km remaining, swiftly followed by Philippe Gilbert (BMC). But it was Luca Paolini who made the most decisive attack, holding off the sprinters teams until there was only 1km left to contest.
Modolo looked well positioned as the riders began their flat run into the finish, with two teammates leading him at the front of the bunch.
Giacomo Nizzolo (Trek Factory Racing) and Luka Mezgec (Giant-Alpecin) were also in the mix, finishing second and third respectively, while red jersey Elia Viviani was boxed out on the final turn and finished well back as Modolo won by a wheel on the line.
There was no change in the GC as all the top ten made it home safely, with maglia rosa Alberto Contador's team particularly prominent in controlling on the front as they guided their leader safely past the 3km mark.
The day's Early break, featuring a threesome of Marco Bandiera (Androni-Sidermec), Giacomo Berlato (Nippo-Vini Fantini) and Iljo Keisse (Etixx - Quick-Step), stretched out a maximum gap of just over three minutes, but were inevitably brought back with 26km remaining.
Adam Hansen (Lotto-Soudal) and Patrick Gretsch (Ag2r-La Mondiale) had an attack off the front shortly after the break was pulled back, before Hansen was reeled in with 9km to go.
Thursday's stage 18 sees the peloton return to the mountains, with a flat run in to a category one climb at just under 50km to the line, before a fast finish after the long descent to Verbania.
Giro d’Italia 2015, stage 17: Tirano – Lugano 136km
1. Sacha Modolo (Ita) Lampre-Merida 3-07-51
2. Giacomo Nizzolo (Ita) Trek Factory Racing
3. Luka Mezgec (Slo) Team Giant-Alpecin
4. Heinrich Haussler (Aus) IAM Cycling
5. Davide Appollonio (Ita) Androni Giocattoli
6. Stig Broeckx (Bel) Lotto Soudal
7. Juan Jose Lobato (Esp) Movistar Team
8. Alexander Porsev (Rus) Team Katusha
9. Kévin Reza (Fra) FDJ.fr
10. Nick Van Der Lijke (Ned) Team LottoNL-Jumbo
Overall classification after stage 17
1. Alberto Contador (Esp) Tinkoff-Saxo, 68-12-50
2. Mikel Landa (Esp) Astana, at 4-02
3. Fabio Aru (Ita) Astana, at 4-52
4. Andrey Amador (CRC) Movistar, at 5-48
5. Yuri Trofimov (Rus) Katusha, at 8-27
6. Leopold Konig (Cze) Team Sky, at 9-21
7. Damiano Caruso (Ita) BMC, at 9-52
8. Steven Kruijswijk (Ned) LottoNL-Jumbo, at 11-40
9. Alexandre Geniez (Fra) FDJ, at 12-48
10. Ryder Hesjedal (Can) Cannondale-Garmin, at 12-49
Thank you for reading 20 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1