Starting from third, Dovizioso passed poleman Vinales en route to the win, Ducati’s first at the circuit since Casey Stoner triumphed back in 2009.
Vinales had spent most of the race up to that point in the lead, and seemed well set to pick up a fourth win of the season, but was powerless to get away from Dovizioso before he fell victim at San Donato on lap 14.
From there, Vinales was briefly passed by the Pramac Ducati of Danilo Petrucci for second, but once back in front, he chose to bank the points for the runner-up spot rather than mounting an all-out assault on Dovizioso.
The result means he now leads the standings by 26 from Dovizioso, with Valentino Rossi 30 adrift after finishing behind Petrucci in fourth.
“When I overtook Valentino I knew I had to do the laptimes,” said Vinales. “I did many [1m]47s, but still Dovizioso was just behind me. I couldn’t open a gap, it was impossible.
“I tried, but today was the day to make points and finish second. Some days you have to finish second, happy to be here in the podium.
“Dovi was riding especially good, it was his day to win. But my bike was at a good level, in the last laps I could have pushed a little bit more, but finally I knew these 20 points today are so important.”
Dovizioso’s achievement was made all the more remarkable by the fact he began the day feeling ill, having suffered from a bout of food poisoning.
But the Italian showed no signs of his ailment during the race as he took only the third win of his MotoGP career and his first in dry conditions.
“I woke up at 4 o’clock, I was sick,” recalled Dovizioso. “The feeling was quite bad before the race, the energy wasn’t so good.
“But my bike worked well, our speed was there. I knew the bike was good to fight for the podium, I didn’t know during the race really what I could do.
“I decided to go in front 10 laps to the end for no reason, but it worked.”