The Lampre-Merida rider finished ahead of Juan Jose Lobato (Movistar) and Simon Gerrans (Orica-GreenEDGE) in an sprint that looked more exhausted than inspired.
The win by Ulissi will be controversial for some as the Italian only recently returned from a nine-month suspension for the banned drug Salbutamol, taken during the 2014 edition of the Giro.
"There are some big sprinters here, so I knew I wasn't the number one favourite today, but I had great legs. I went early because I was afraid of getting caught from behind. This is a special win for me after the difficult year I've had, and I want to thank my family - my wife, my parents and my in-laws - and also my friends for all their support." - Diego Ulissi.
Stage 7 ran 264km from Grosseto to Fiuggi and finished with enough elevation to test legs already tired after six active days of racing.
Entering Fiuggi, the peloton was presented with a gradient of about twi per cent into the final kilometre and rising slightly again to 3-4 per cent in the final 35 metres. Usually easily handled on a shorter stage this was testing after seven hours in the saddle.
On paper it suited punchy stayers like Gerrans and and not a pure sprinter like Andre Greipel (Lotto-Soudal). Ulissi's riding style is similar to Gerrans, and while the result may seem a surprise, it wasn't in the context of his career.
The fears of organisers were allayed when an injured Alberto Contador lined up for the start after dislocating his shoulder in a Stage 6 crash. The Tinkoff-Saxo rider appeared relaxed troughout and finished unscathed but there remains some doubt about his overall fitness.
The result also left the general classification unchanged with Contador maintaining his lead over Fabio Aru (Astana) and Australian Richie Porte (Sky).
"It was a hard day for me but I'm happy because I got through it. After three and a half or four hours, I didn't know what to do with my arm, but I hope and trust that, as the days past, it will improve. Tomorrow is a stage that I was looking forward too. Now it's going to be hard for me, and I expect attacks. Now I'm just thinking of resting and putting ice on my shoulder. Then we'll see." - Alberto Contador.
Marco Bandiera (Androni Giocattoli), Nicola Boem (Bardiani-CSF), Nikolay Mihaylov (CCC Sprandi), and Pier Paolo De Negri (Nippo-Vini Fantini) launched the break of the day and at one point held a lead that reached 11 minutes.
The quartet soaked up all of the major intermediate sprint points but by the last checkpoint at Cave, the time gap to the peloton had been cut to a single minute.
The end for the break came with just 20km to go as Orica-GreenEDGE, Sky, Trek Factory Racing, Astana, Lotto-Soudal and Giant-Alpecin taking turns at the front driving the pace.
Fast forward to the final kilometre and it was every rider for himself. There was no organised leadout and it became a race to see who had the most left in their legs. The answer was Ulissi.
Stage 7: 264km, Grosseto - Fiuggi
1 Diego Ulissi (ITA) Lampre-Merida 7hr 22min 21sec
2 Juan Jose Lobato (ESP) Movistar
3 Simon Gerrans (AUS) Orica-GreenEDGE
4 Manuel Belletti (ITA) Southeast
5 Enrico Battaglin (ITA) Bardiani CSF
6 Sonny Colbrelli (ITA) Bardiani CSF
7 Fabio Felline (ITA) Trek Factory Racing
8 Grega Bole (SLO) CCC Sprandi Polkowice
9 Kévin Reza (FRA) FDJ.fr
10 Sergey Lagutin (RUS) Katusha
1 Alberto Contador (ESP) Tinkoff-Saxo 27hr 42min 00sec
2 Fabio Aru (ITA) Astana 0:00:02
3 Richie Porte (AUS) Sky 0:00:20
4 Roman Kreuziger (CZE) Tinkoff-Saxo 0:00:22
5 Dario Cataldo (ITA) Astana 0:00:28
6 Esteban Chaves (COL) Orica-GreenEDGE 0:00:37
7 Giovanni Visconti (ITA) Movistar 0:00:56
8 Mikel Landa Meana (ESP) Astana 0:01:01
9 Davide Formolo (ITA) Cannondale-Garmin 0:01:15
10 Andrey Amador (CRC) Movistar 0:01:18