General manager Mike Rizzo announced the deal. Rosenthal will make a guaranteed $7 million, and he can earn an additional $8 million in performance bonuses.
Rosenthal, a former closer for the St. Louis Cardinals, sat out last season after he had Tommy John surgery on his throwing arm. He had a career-high 48 saves in 2015 and was a National League All-Star.
He had only 14 saves in 2016 and 11 in 2017 before getting injured.
The 28-year-old is the first offseason signing for the Nationals and looks to bolster their bullpen. He has 121 career saves.
The Associated Press contributed to this report.