"Big news," Martin wrote on his Twitter account. "Beyond blessed."
In another Tweet, he wrote: "Opportunities are few in the NFL... Can't wait to get to work #9erEmpire."
The 49ers had opened free agency with a sudden swap of safeties, adding safety Antoine Bethea, a two-time Pro Bowler from the Indianapolis Colts, after Donte Whitner left to join his hometown Cleveland Browns.
In other moves, the 49ers re-signed kicker Phil Dawson (two years) and cornerback Eric Wright (one year) and made another surprising trade: getting quarterback Blaine Gabbert in a deal with Jacksonville. Gabbert, the 10th overall pick in the 2011 draft, has been such a disappointment that the Jaguars parted company with him for a sixth-round pick and the possibility of more compensation depending on Gabbert's role with the 49ers in 2014.
That is not expected to be much, at least in the view of Bill Polian, the former Indianapolis Colts executive who now serves as an analyst for ESPN.