SANTA CLARA (CBS SF) — Hours after inking defensive lineman Arik Armstead to a new long-term contract, the 49ers turned their attention to another key free agent, starting free safety Jimmie Ward.

The two sides agreed to a three-year deal that could be worth up to $28.5 million dollars according to multiple reports.

Ward emerged as a key piece in the San Francisco secondary after moving from cornerback to safety full-time and was named a Pro Bowl alternate last season. The 30th overall pick in 2014, Ward has battled injuries during his time with the 49ers, missing 32 games in six seasons.

The 28-year old made it clear after the season that staying in San Francisco was his first choice.

“They (49ers front office) have the upper hand right now because I do want to be in California,” he said. “But if not, I’ll go to any team that wants me to play safety. That’s the only way I’ll sign with a team. I’m a safety first.”