The San Francisco Giants have agreed to a two-year contract with Tim Lincecum, which keeps the two-time Cy Young winner from reaching free agency.

Jon Heyman is reporting that the deal is worth $35 million through the 2015 season.

The 29-year-old posted a 4.37 ERA with 8.8 K/9 and 3.5 BB/9 in 2013.