Nelson agreed to terms on a four-year contract extension with the 49ers on Tuesday, Field Yates of ESPN reports.
Nelson was set to become an unrestricted free agent March 13 but worked out a long-term deal with the 49ers just ahead of the deadline to do so. The 32-year-old will serve the final six games of a 10-game suspension for violating the NFL's performance-enhancing substance policy to begin the 2019 season, but will be eligible to participate in all offseason and preseason practices.