Rolland (Cannondale-Drapac) accelerated from a large group of breakaway riders with about five kilometres to go in the 219km leg from Tirano to Canazei, which featured three categorised climbs.
He had been part of the breakaway from the start of the stage, which included climbs over the Aprica and Tonale passes with his decisive breakaway coming on the Val di Fassa.
"At the end, it was a question of courage," Rolland said. "I caught the right moment. It's a huge relief."
It was Rolland's first career win in the Giro, having won two stages in the Tour de France in 2011 and 2012. He hadn't posted a win since taking overall victory in the Castilla and Leon tour at the start of 2015.
"I've waited for this moment for such a long time," he said.
"In 2015 I finished second in a Tour de France stage, and last year was just a year to forget for me. I crashed twice in the Tour. It's been a long wait."
Rolland credited his form to his work over the winter with Cannondale general manager Jonathan Vaughters.
"My winter was so so hard, and now I've won because of my work," he said.
Rui Costa (UAE Team Emirates) won the sprint for second, crossing 24 seconds behind Rolland. Gorka Izaguirre (Movistar) crossed third.
The main pack including Dumoulin and all of the other contenders finished nearly eight minutes behind.
Dumoulin remained 31 seconds ahead of 2014 champion Nairo Quintana (Movistar), with two-time champion Vincenzo Nibali (Bahrain-Merida) third, 1min 12sec behind.
Dumoulin was untroubled on the stage which came after he struggled with stomach problems a day earlier, a welcome respite ahead of another gruelling leg Thursday across the Dolomites.
"We were never worried," Dumoulin said. "We just had to chase harder than we expected. I knew other teams would stress for their jerseys, and come to help.
"But they waited very long to pull. It was their decision. My boys did an amazing job and my jersey is safe."
Stage 18 is a 137km leg from Moeana to Ortisei in the Val Gardena that features four categorised climbs, including an uphill finish.
"I expect Vincenzo and Nairo to make it very hard for me tomorrow," Dumoulin said.