The 31-year-old Yanda was in the final season of a contract he signed in 2011.
Yanda was a third-round pick out of Iowa by the Ravens in 2007. He started on Baltimore's 2012 Super Bowl champion team.
He has played in 120 games, including 109 starts, over nine NFL seasons. Only two offensive linemen - Hall of Fame left tackle Jonathan Ogden and center Mike Flynn - have played more games with the Ravens.
Yanda says, ''Hopefully, I will finish my career as a Raven.''
The deal was announced Friday.
Ravens general manager Ozzie Newsome says, ''Marshal is not only a staple of our offensive line, but also a staple of our entire team. He is the best of what a Raven should be.''
AP NFL website: www.pro32.ap.org and http://twitter.com/AP-NFL