Johnson made his season debut on April 14, 2008, against the San Francisco Giants at AT&T Park eight months following his back surgery. On June 3, 2008, Johnson struck out Mike Cameron of the Milwaukee Brewers for career strikeout number 4,673. With this strikeout Johnson surpassed Roger Clemens for the number two spot on the all-time strikeout leaders list. Johnson struck out 8 in the game but could not get the win as the Diamondbacks lost 7–1.
Johnson got his 4,700th career strikeout on July 6, 2008. He finished the season with an 11–10 record and an ERA of 3.91, recording his 100th career complete game in a 2–1 victory over the Colorado Rockies.
On December 26, 2008, Johnson signed a one-year deal with the San Francisco Giants for a reported $8 million, with a possible $2.5 million in performance bonuses and another $2.5 million in award bonuses. Johnson became the 24th pitcher to reach 300 wins, beating the Washington Nationals (the team that he first played for when they were known as the Montreal Expos) on June 4 at Nationals Park in Washington, D.C. He became the seventh left-handed pitcher to achieve the 300-win milestone and the fifth pitcher in the last 50 years to get his 299th and 300th win in consecutive starts, joining Warren Spahn, Steve Carlton, Gaylord Perry, and Tom Seaver. Johnson was placed on the 60-day disabled list with a torn rotator cuff in his throwing shoulder on July 28, 2009. Johnson was activated by the Giants on September 16, 2009, and assigned to the Giants bullpen. On September 19, 2009, Johnson made his first relief appearance in 4 years, facing the Los Angeles Dodgers for 3 batters. At age 46, he was at the time the second oldest player in Major League Baseball, trailing only Jamie Moyer.