On a day when team-mate Jorge Lorenzo was confirmed as the new MotoGP champion, former champion Valentino Rossi reminded Yamaha of what they will be missing next year as he charged from 11th to 1st.
The victory - the closest of the year, by just 0.224sec over Honda's Andrea Dovizioso - was Rossi's first victory since round one in Qatar.
Rossi had missed four of the 14 races since Losail after breaking his leg at Mugello, and his Sepang win had extra significance as it was his 46th win for Yamaha.
"This is a wonderful moment for me, I am so happy to win like this and take my 46th win with Yamaha on 'my' M1," said Rossi.
"It was one of my worst starts and for a moment I was really worried, but within a few corners I understood that I could go for it, because my bike felt great today thanks to a small change we made in warm-up, Jeremy's idea really worked!
"I rode so well and it was a fantastic race, one of the best of my career I think. I wanted this 46th win so much because as everyone knows it's a special number for me!
"Thanks to my team because everyone worked so hard this weekend and I think this is a great repayment for everyone. To win like this, from 11th at the first corner, is a great feeling.
"Finally I want to say congratulations to Yamaha and to Jorge; he has been fast all season, at all tracks and in all conditions and he deserves to be the World Champion."
Rossi's victory brought to an end his longest losing streak in the premier-class and Fiat Yamaha team manager Davide Brivio is hoping for further M1 wins in the three races that remain in 2010.
"What a race! It was a fantastic race and great weekend because we had a difficult day yesterday and could only qualify sixth, but the team did a great job to change the bike and Valentino felt very comfortable in the race," said Brivio. "He rode very well, making the fastest lap in the race and coming from 11th position and 2.5 seconds down on the leaders on the first lap.
"This milestone 46th win was a great way to celebrate Valentino's amazing time with Yamaha. It's a wonderful day for Yamaha all round because Jorge is the World Champion so we say congratulations to him, he's been very strong this year. All of our team are very happy today! Now we're looking forward to Australia, another great track for Valentino, and we hope his victories are not over with yet with Yamaha."
The win moves Rossi up to third in the championship, one point ahead of Casey Stoner, who crashed out of the race.