Per team policy, financial terms were not disclosed. MLB.com has reported that the deal is worth $8 million, plus incentives.
Johnson, 45, trails only Roger Clemens (six) in career Cy Young Awards and went 11-10 last season with a 3.91 earned run average in 30 starts for the Arizona Diamondbacks.
"We are extremely excited to bring Randy Johnson to the Giants organization," said Giants general manager Brian Sabean. "Randy continues to be one of the most intimidating and competitive pitchers in baseball today. He commands respect and will have a dramatic influence on the way the 2009 team conducts business."
The 2009 Giants rotation will now bolster three Cy Young Award winners, including the 2008 National League winner Tim Lincecum. Barry Zito also won the award while in the American League with the Oakland Athletics. No team has had three Cy Young Award winners in the same rotation since the 2002 Atlanta Braves, who had Tom Glavine, John Smoltz and Greg Maddux.
Johnson will bring an intimidating presence and postseason experience to San Francisco, having won a World Series in 2001 with Arizona and played in eight Division Series and two League Championship Series.
A veteran of 21 seasons, Johnson is just five wins away from the elusive 300- win club, going 295-160 with a 3.26 ERA lifetime with the Expos, Mariners, Astros, Diamondbacks and Yankees. In his career he has recorded 37 complete game shutouts and 4,789 strikeouts, which is second all-time to Nolan Ryan (5,714).
Johnson also tossed the last perfect game in major league history, a 2-0 Arizona win over Atlanta on May 18, 2004.
The move marks the fourth free agent signing for the Giants this offseason, having already inked relief pitchers Jeremy Affeldt and Bob Howry and shortstop Edgar Renteria to contracts.