The 25-year-old Spaniard, who was MotoGP world champion in 2010, finished runner-up in 2009 and 2011, and leads this year's classification by 20 points after winning three of the opening five races, is now tied to Yamaha until 2014.
"I am extremely happy to have signed with Yamaha for two more years. They've made great efforts to retain me in the factory team so I want to thank all those involved at Yamaha for this," said Lorenzo, who joined the team in 2008.
"It has always been my first option to stay here and so I'm happy that this important negotiation has finished with such a positive outcome. Now I can focus on the championship and I'm looking forward to paying back Yamaha's trust in me starting at Silverstone this weekend.
"My dream to finish my career with Yamaha is now closer to becoming a reality!"