The deal with the six-foot-two, 210-pound Hartnell kicks in after the 2012-13 season, when he is scheduled to make $3.2 million in the final year of his previous contract.
The 30-year-old had 37 goals and 30 assists in 82 games with the Flyers in 2011-12. He also added three goals and five assists in 11 playoff games.
In 843 career NHL games with the Flyers and Nashville Predators, Hartnell has 222 goals, 252 assists and 1,279 penalty minutes. He also has 19 goals and 24 assists in 84 playoff games.
The Regina native was Nashville's first pick, sixth overall at the 2000 draft.