Right-hander Ross Stripling and San Francisco on Tuesday agreed to a two-year, $25 million contract that includes an opt-out after the first season, enriching a Giants rotation with another free agent acquisition.

On the heels of signing left-hander Sean Manaea to the same deal, the Giants locked up Stripling, a 33-year-old coming off a career-best season in Toronto. Working mostly as a starter, Stripling (10-4) put up a 3.01 ERA over 134⅓ innings, striking out 111 and walking just 20.

Stripling, who is getting a $5 million signing bonus, will earn $7.5 million in 2023 and $12.5 million in 2024.