Brian Hoyer has agreed to sign a two-year, $12 million deal with the San Francisco 49ers.

There is an understanding Hoyer will have a chance to start for the 49ers.

Hoyer, 31, performed well in five starts for the Chicago Bears last year, but his season ended when he broke his left arm at Green Bay in Week 7. He threw for 1,445 yards, six touchdowns and no interceptions.

Hoyer started 16 games for the Browns from 2013-14, and he made nine regular-season starts for the Houston Texans in 2015, passing for 2,606 yards, 19 touchdowns and seven interceptions.