"He brings to our club the closer we need for us to continue our pursuit of a World Series," general manager Doug Melvin said.
The 41-year-old righty, who had pitched for San Diego since 1993, has 554 saves in 930 relief appearances over his 16-year career.
Hoffman went 3-6 with a 3.77 ERA and 30 saves in 34 opportunities last season. The six-time All-Star can earn an additional $1.5 million in performance bonuses based on games finished.
"We are going to miss hearing 'Hells Bells' and seeing No. 51 walk through that center-field gate. He has been a constant professional both on and off the field and we wish him the best of luck as he continues his Hall of Fame career," general manager Kevin Towers said.
Said Padres chairman John Moores: "It has been a privilege watching Trevor earn 552 saves in a Padres uniform."