It is the longest extension given to any Pittsburgh player since Dave Littlefield became general manager in 2001.
"Never did I ever think that something like this was going to happen," Bay said at a news conference. "That makes it equally special. It's almost like getting called up to the big leagues again, because I never expected any of this."
Bay, 27, played in all 162 Pirates' games in 2005, and was an all-star. He batted .306 with 32 home runs, 44 doubles, 22 stolen bases, 110 runs scored and 101 RBI. He had 41 points to finish 12th in the balloting for National League Most Valuable Player.
In 2005, he became the first player in team history to hit .300 with at least 30 home runs, 40 doubles, 20 stolen bases, 100 runs scored and 100 RBI in the same season.