Safety Jimmie Ward is not going anywhere.

The 49ers on Monday night agreed to terms with safety Jimmie Ward on a three-year contract, a league source told NBC Sports Bay Area. The deal is worth $28.5 million, the NFL Network reported.

The move prevents Ward from hitting the open market Wednesday afternoon as an unrestricted free agent.

The re-signing of Ward caps an active first day of the open negotiating period for the 49ers. The 49ers signed defensive lineman Arik Armstead to a five-year contract. Then, the 49ers traded defensive lineman DeForest Buckner to the Indianapolis Colts for a 2020 first-round draft pick.

Ward appeared in 16 games last season for the 49ers after missing the first three games of the season after surgery to repair a fractured finger. Ward started the team’s final 13 games of the regular season and all three playoff games.

With Ward and Armstead re-signing with the team, the 49ers’ top remaining free agent is wide receiver Emmanuel Sanders.

[RELATED: Why 49ers traded Buckner, kept Armstead]

Ward, 28, a sixth-year veteran, was a first-round draft pick of the 49ers in 2014. Ward landed on injured reserve four times -- with a fractures to his foot and shoulder blade and two forearm fractures -- in his first five season. Last season, he registered 65 tackles with a sack and eight passes broken up.