Aleix Espargaro made handsome amends for an embarrassing error last year at his home Montmelo circuit by claiming Saturday's Catalunya MotoGP sprint race.
World champion Francesco Bagnaia took second to extend his lead in the riders' standings with Maverick Vinales completing the podium.
Espargaro, born a few kilometres from the Barcelona track, nipped past Bagnaia at the halfway stage, quickly pulling half a second clear.
The Aprilia rider, who had lit up Friday's practice, was not to be denied in front of his local fans.
He crossed the line over two seconds in front to follow up his win in the British Grand Prix at Silverstone.
The win also helped erase the memory of his howler at the circuit last year.
Setting off from pole, he was running second to Fabio Quartararo when he celebrated making the podium one lap too early.
By the time he realised his mistake, three riders had passed him and he finished in fifth.
With the slogan "One more lap" painted on his helmet on Friday, he made amends in style on Saturday, with Sunday's main event to come.
"This is my first sprint victory and to do it at my home track is special," said the race winner who dedicated the victory to Roberto Colaninno, the Aprilia boss who died aged 80 a fortnight ago.
"It's a good day to say thank to our president who we lost a few weeks ago. This is for him," said Espargaro.
Bagnaia, who extended his lead in the championship to 66 points over Jorge Martin (fifth in the sprint), reflected: "It's obviously better to win but in any case I'm happy with the result.
"The Aprilias are very competitive here, so it's a positive gaining points for the title.
"We will fight again tomorrow!"
Bagnaia, who had claimed pole on his factory Ducati with a record lap time in qualifying, got off to his usual speedy start.
Vinales jumped from fourth to second by turn one.
The Aprilia rider's teammate Espargaro, on his local track, quickly had the Italian's measure.
With the circuit covered by cloud, Espargaro ate into Bagnaia's lead. The gap was down to under two tenths of a second with three of the 12 laps completed.
As Espargaro's brother Pol crashed out, the leading pair began to pull clear of the chasing pack headed by Vinales.
Espargaro sped away for an emphatic win with Vinales pressing Bagnaia over the closing lap but the world champion fended him off to take his ninth sprint podium out of 11 this season.