Updated

San Francisco, CA (SportsNetwork.com) - Tim Lincecum has agreed to terms on a two-year deal with the San Francisco Giants through the 2015 season, keeping the two-time Cy Young Award winner off the free-agent market.

The deal is pending a physical, the Giants said Tuesday.

The contract is worth $35 million, according to CBSSports.com and the San Francisco Chronicle -- down from the two-year, $40.5 million deal Lincecum signed in January 2012 after his fourth straight All-Star Game appearance.

Lincecum's production has decreased the past two seasons. The right-hander -- who has won two World Series titles with the Giants -- has posted a 20-29 record with a 4.76 earned run average and 383 strikeouts in 65 starts in 2012-13 after going 69-41 with a 2.98 ERA and 1,127 strikeouts from 2007-11.

The 29-year-old did throw his first career no-hitter this season, striking out 13 against the Padres on July 13. He finished the season 10-14 with a 4.37 ERA and 193 strikeouts in 197 2/3 innings.

The Giants had already locked up outfielder Hunter Pence with a five-year deal last month.