Hagelin counts $2.75 million against the salary cap through the 2022-23 season. General manager Brian MacLellan announced the deal Sunday.
Washington acquired Hagelin from Los Angeles prior to the trade deadline this past season. He scored three goals in 20 regular-season games with the Capitals after scoring just two in 38 games with the Pittsburgh Penguins and Kings.
Hagelin figures to be a lynchpin of the Capitals' third line. The team cleared the necessary salary cap space to re-sign Hagelin and others by trading defenseman Matt Niskanen to the Philadelphia Flyers for Radko Gudas.
The 30-year-old Swede won the Stanley Cup with Pittsburgh in 2016 and 2017. He has 241 points in 546 NHL regular-season games.
"Carl is a versatile player who can play on any line and is an excellent penalty killer," MacLellan said. "He is a proven winner and provides great leadership to our team."
With the potential departure of veteran blue liner Brooks Orpik, Hagelin could be counted on to take a bigger leadership role this fall in his first full season in Washington. He also will be counted on to produce if winger Brett Connolly departs in free agency or the Capitals don't re-sign Andre Burakovsky.