San Francisco or Los Angeles for Zack Greinke?

Neither.

Greinke, the 32-year-old right-hander who was runner-up in this year’s Cy Young Award vote, has agreed to a six-year contract with the Arizona Diamondbacks for $206.5 million, sources confirmed Friday night. Greinke must pass a physical for the deal to become official.

In a surprise move, Zack Greinke is headed to Arizona. (AP Photo/Alex Gallardo) More

The Diamondbacks’ willingness to commit to a sixth year for Greinke (along with a record average annual value of more than $34 million) appeared to be the difference in what had become a three-team race of National League West foes, and is a massive commitment for a franchise whose 2015 payroll was $88 million, about a third of the Dodgers’.

It’s a big, risky play on a 32-year-old pitcher for the Diamondbacks, who do have a talented young group of players, and are now relevant again in the NL West, and also are gambling future seasons on Greinke’s production and health. The Dodgers, who have no budgetary constraints, would have passed based solely on principle, and now likely turn to second-tier free agents such as Johnny Cueto, Jeff Samardzija, Mike Leake and Scott Kazmir, same as the Giants.

The contract is technically the second major deal in the past three years for Greinke, who in early November opted out of his final three seasons (and the last $71 million) with the Dodgers.

Spurned in recent weeks by Cueto, who rejected $120 million over six years, the Diamondbacks went into the offseason desperate for starting pitching. They shot high for Cueto, then higher for Greinke, who they will put at the top of their rotation, ahead of Patrick Corbin, Rubby De La Rosa, Robbie Ray and Chase Anderson. The Diamondbacks’ starting pitching was below average in 2015, and ultimately undermined one of the better offenses in the league.

The contract follows two of significance this offseason for free-agent pitchers. The Detroit Tigers signed right-hander Jordan Zimmermann to a five-year, $110-million contract. Several days later, left-hander David Price signed for a record $217 million over seven years with the Boston Red Sox. In the Jetstream of those deals came Greinke, and what was believed to be a contest of wills (and dollars) between the Dodgers, the wealthiest franchise in the sport, and the Giants, three-time World Series champion this decade.

Both had money socked away for Greinke. Both required his services. The Dodgers required a man inches behind Clayton Kershaw, as Greinke just completed the finest season of his career in that very role. The Giants, who’d built those titles on pitching, desired a 1B to Madison Bumgarner’s 1A, face a possible career downturn of Matt Cain and the free agency (and career downturn) of Tim Lincecum.

Instead, along came the Diamondbacks, Corbin’s continued return from Tommy John surgery, Paul Goldschmidt’s near-MVP talent, A.J. Pollock’s breakout 2015, and now an ace in Greinke, all now a challenge to the Dodgers and Giants.

The deep thinking, somewhat eccentric, often wry and hyper-athletic Greinke emerged in 2015 as the Dodgers’ co-ace, an extraordinary development given his partner at the top of the rotation was three-time Cy Young Award winner (and one-time MVP) Kershaw.

In spite of forecasts his personality might be ill-suited for a large-market franchise, Greinke shined in three seasons with the Dodgers, for whom he was 51-15 with a 2.30 ERA. His 2015 season was among the best in club history. Greinke was 19-3 with a league-leading 1.66 ERA. He threw a career-high (with the postseason) 236 1/3 innings, and in the regular season posted 200 strikeouts to 40 walks, and career bests in hits per nine innings and WHIP. Over six starts, from June 18 to July 19, he did not allow a run. He lost once after June 13 until Oct. 15, when he was outpitched by Jacob deGrom in Game 5 of the division series.

Story continues