49ers keep Ray McDonald

Free agent defensive lineman Ray McDonald is staying in San Francisco.

Adam Schefter of ESPN reports that the 49ers reached an agreement with McDonald on a five-year, $20 million deal that includes $7 million guaranteed.

McDonald has played his entire four-year career with the 49ers. He has played in all 32 games the last two seasons, but hasn’t started any.

Matt Barrows of the Sacramento Bee notes that McDonald was one of the 49ers’ top priorities to re-sign, and he’ll likely step in as the starter at left defensive end if Aubrayo Franklin leaves.