The outgoing world champion dominated the final round of the 2016 season at Valencia, leading from pole position to chequered flag and ending a five month victory drought for his team.
Lorenzo held off a late charge from new world champion Marc Marquez, while Andrea Iannone rounded out the podium in third after winning a race-long scrap with Valentino Rossi.
“This was my final gift to Yamaha,” Lorenzo, who will join Ducati for 2017, said.
Lorenzo checked out in the early laps while a fast-starting Iannone, leaping from the third row, acted as a cork in the bottle for the rest of the pack.
Marquez went the other way, falling to seventh after a slow start from the front row.
“The biggest problem of the race was the start, I lost a lot of positions,” Marquez said.
“But then it wasn’t so difficult to overtake. I tried to stay calm and attack.”
Marquez picked off those in front of him one-by-one until reaching the back of Iannone and Rossi. He spent several laps sizing them up before carving his way up to second and slicing time out of Lorenzo’s lead.
“With a couple more laps maybe I could have made the pass for the win,” Marquez said.
Lorenzo, in his 250th grand prix start, said he worried about losing the victory toward the end.
“I suffered those last 10 laps,” he said. “I knew he (Marquez) was attacking so I was pushing to the limit.”
Maverick Vinales rounded out the top five, while Pol Espargaro, Andrea Dovizioso, Aleix Espargaro, Bradley Smith and Alvaro Bautista completed the top 10.
Jack Miller left the final race of the season with a point in his pocket for 15th place.
Marquez will receive his world champion’s trophy in the sport’s prizegiving ceremony on Sunday night, but there won’t be much time to rest.
Preparations for the 2017 season begin on Tuesday with the first round of pre-season testing.