Cain, 32, will make his final start for San Francisco on Saturday against the Padres in San Diego. His eight-year, $139.75 million deal with the club expires after this season, and the Giants will pay him a $7.5 million buyout instead of exercising his $21 million club option for next season.
After being selected as the 25th overall pick as a high-schooler in 2002, Cain reached the majors for the first time in 2005 and has been a mainstay in the Giants rotation ever since. Over 13 seasons, the righty owns a career 104-118 record and 3.69 ERA while registering eight seasons of more than 180 innings. He has been an All-Star on three occasions and received Cy Young votes in each year from 2010 to 2012.
Cain has struggled to stay on the mound over the last three years and posted a 3-11 record and 5.66 ERA in 119.1 innings for the last-place Giants this year. The three-time World Series champion would have likely been a candidate for a minor-league deal in free agency this winter.
San Francisco will move forward with Madison Bumgarner, Jeff Samardzija and Matt Moore that could include Johnny Cueto (if he opts in), Chris Stratton, Tyler Beede, Andrew Suarez and potential free-agent additions in 2018. The club will try to rebound from a last-place finish in the NL West this season.