SCOTTSDALE, Ariz. (CBS SF) — Looking to bolster their infield depth, the San Francisco Giants announced Wednesday that they have signed veteran Wilmer Flores to a two-year contract worth $6.25 million.

Team officials said Flores will make $3 million in both 2020 and 2021 with a club option for the 2022 season that would pay the veteran infielder $3.5 million. If the club does not exercise the option, Flores would be entitled to a $250,000 buyout.

READ MORE: 'Highway Slingshot Shooter' Fires Ball Bearings at Windows Along San Jose's Guadalupe Freeway

“The addition of Wilmer Flores gives us great flexibility with his ability to play across the infield,” President of Baseball Operations Farhan Zaidi said. “Offensively, he matches up well against both right-handed and left-handed pitching and adds another bat to the mix that can help lengthen our lineup.”

The 28-year-old Flores, who spent the 2019 season with the division-rival Arizona Diamondbacks, batted .317 with 18 doubles, nine home runs and 37 RBI in 285 plate appearances last season. Batting against left-handed pitching in 2019, he had a batting line of .337/.367/.615 over 109 plate appearances.

He was red-hot in August when he led all Major Leaguers with at least 50 plate appearances in average .451 (23-for-51), on-base percentage (.491), slugging percentage (.824) and OPS (1.314).

Flores played his first six seasons with the New York Mets and is a .268 career hitter with 245 runs scored, 114 doubles, two triples, 77 home runs and 290 RBI in 670 games. He has experience across the infield, starting 148 career games at shortstop, 133 at second, 128 at third and 115 at first base.

READ MORE: 3 East Bay School Districts Go All-In on Student Vaccine Mandates

To make room on the 40-man roster for Flores, pitcher Reyes Moronta has been placed on the 60-day injured list with a right shoulder strain.

Earlier Wednesday, the Giants agreed to a minor league contract with right-hander Trevor Cahill, and he participated in the first spring training workout for pitchers and catchers.

Cahill, 31, joined his eighth team in 12th major league seasons and his sixth n six seasons following stints with the Chicago Cubs, San Diego Padres, Kansas City Royals, Oakland Athletics and Los Angeles Angels.

Cahill made his major league debut with the A’s in 2009. He’s 84-92 in his career with a 4.77 ERA.

MORE NEWS: State-of-the-Art Water Purification Plant Helps Silicon Valley Battle Drought

With the Angels in 2019, Cahill went 4-9 with a 5.98 ERA in 37 games with 11 starts. He could compete for the fifth starter role in the Giants rotation, though he’s also been an effective reliever over his career.