The deal, announced on Tuesday, carries an average annual value of $3.5 million.
The 26-year-old Rust set career highs in both assists (25) and points (38) while playing in 69 games for the Penguins this season and added three goals in 12 playoff games.
Rust was a pivotal member of the Penguins as they won consecutive Stanley Cups in 2016 and 2017.
He has 10 goals and one assist in 18 career elimination games and has 21 points in 58 career playoff games for Pittsburgh. Four of his 16 career playoff goals have been game winners.