SAN FRANCISCO — Tim Lincecum is staying put with the San Francisco Giants just as he hoped, reaching agreement Tuesday on a $35 million, two-year contract through the 2015 season.

SAN FRANCISCO — Tim Lincecum is staying put with the San Francisco Giants just as he hoped, reaching agreement Tuesday on a $35 million, two-year contract through the 2015 season.

The deal is pending a physical, which had yet to be scheduled. Lincecum has a full no-trade clause in the new deal.

General manager Brian Sabean said when the season ended that among his top priorities was bringing back the two-time NL Cy Young Award winner, who also indicated he cherishes familiarity and wanted stay with the only club he has known. He pitched the Game 5 clincher in the 2010 World Series at Texas, then shifted to the bullpen and became a reliable reliever during the Giants' 2012 run to their second title in three years. He pitched a no-hitter July 13 at San Diego.

Sabean wanted to lock up Lincecum's deal before he hit the open market in free agency.

The 29-year-old Lincecum just completed a $40.5 million, two-year contract that paid him $22 million this past season.

The Giants, who missed the playoffs at 76-86, already took care of their first order of business by signing right fielder Hunter Pence to a $90 million, five-year contract before the season ended. He played every game this year.

Lincecum, the 10th overall draft pick by San Francisco in 2006 out of Washington, has had losing records in each of the past three seasons but manager Bruce Bochy has expressed encouragement with the pitcher's progress to make changes to not only his delivery and mechanics but also his between-start routine and fitness.

After his final start of the season Sept. 26 against the rival Los Angeles Dodgers, the four-time All-Star reflected on the idea of a possible departure. Many thought he might listen to his hometown Seattle Mariners if they came calling.