The club made the announcement on Friday, saying it wouldn't disclose additional terms.
The 29-year-old Gustavsson went 16-5-4 during 27 appearances while backing up Jimmy Howard last season. He posted a 2.63 goals-against average and a .907 save percentage.
Gustavsson started two games during Detroit's first-round playoff series against the Boston Bruins.
The Swede also played with the Red Wings during the 2012-13 season. Gustavsson spent three seasons with the Toronto Maple Leafs and has represented his home country at the Olympics.