Danilo Petrucci, an Italian riding for local team Ducati, held off defending world champion Marc Marquez to gain a first ever MotoGP victory on Sunday in the Italian Grand Prix.
The second place allowed Spaniard Marquez to increase his lead in the world championship ahead of another Italian on a Ducati, Andrea Dovizioso, who finished third on Sunday after a prolonged three-way battle.
Five-time MotoGP champion Marquez, on a Honda, briefly took the lead in the last lap but Petrucci recaptured first place and won.
"It's amazing, I'm thrilled," said 28-year-old Petrucci, who finished eighth in the 2017 and 2018 world championships.
"In front of my home crowd and in my town, it's incredible, I can't describe how I feel.
"I've achieved my aim for this year which was to win a race, now we have to win the championship with Ducati."
Marquez -- winner of three out of six races this season -- started on pole but had to battle with the Ducati riders and Suzuki's Alex Rins, who challenged hard despite starting back on the grid.
The four riders overtook each other several times but Petrucci found the power to pull clear in the closing stages of the final lap of the fast Mugello circuit.
The Italian finished 0.043sec ahead of Marquez with Dovizioso at 0.338.
Dovizioso had on Saturday established a new outright speed record in MotoGP, clocking 356.7km/h in the third practice, to overtake the mark of 356.5 km/h also achieved at Mugello last year.
Marquez, who has won the MotoGP category race just once on the circuit north of Florence, leads Dovizioso by 12 points after six rounds this season.
"When I saw at the start that I couldn't pull clear I said to myself 'today isn't the day'," said Marquez.
"I decided to ride defensively and I'm happy with the 20 points."
Dovizioso added: "It was really hot and I wanted to be ahead in the final lap but Dani overtook us.
"The grip was not enough to try something desperate and Rins almost passed me.
"In the championship we lose some points but I'm really happy for Petrucci because Mugello is the best race for us to win."
Italian star Valentino Rossi crashed out of his home race where the Yamaha rider has not won since 2008 after an impressive series of seven consecutive victories.
The seven-time MotoGP champion had a forgettable weekend as he qualified down in 18th position.
Rossi made contact with Suzuki's Joan Mir on lap five, running through the gravel at Turn 4, and dropping to the back of the field, before crashing out three laps later, for his first retirement of the season.
"Is very difficult weekend, one of the worst for a long time because we are never fast," Rossi said.
"We arrive here knowing that it is difficult, but we expect to be strong in Mugello. But unfortunately was not like this and in all the practice I was not so fast."
Earlier Marquez's younger brother Alex won the Moto2 category having also won at Le Mans last time out.
Alex Marquez led a Kalex sweep ahead of teammates Italian Luca Marini, Rossi's half-brother, and Swiss Thomas Luthi.
The Spaniard pulled clear of his rivals on lap 14 of 21 to finish 1.928sec ahead of Marini with Luthi at 2.242.
For Marquez, 23, it was his fifth victory since he began racing in the category in 2015.
Italian Luca Baldassari holds the overall world championship lead after finishing fourth but is just two points ahead of Marquez.
Italian teenager Tony Arbolino stormed to a maiden career victory as the Honda rider won the Moto3 race.
Arbolino, 18, pipped Italian teammate Lorenzo Dalla Porta, who finished 0.029sec behind, with Spanish KTM rider Jaume Masia third at 0.078.
Spaniard Aron Canet of KTM finished seventh to hold the overall world championship lead ahead of Dalla Porta.