NASHVILLE, Tenn. -- Zack Greinke and the Arizona Diamondbacks have finalized their $206.5 million, six-year contract, a deal with a $34.4 million average salary that is the highest in baseball history.

The Diamondbacks beat out NL West rivals Los Angeles and San Francisco to sign the major league ERA leader and runner-up for the NL Cy Young Award, who helped the Dodgers win their third straight division title this season.

Greinke signed a $147 million, six-year deal with the Dodgers in December that included an opt-out clause. He will wind up earning $282.5 million over nine seasons.

More from FoxSports

His average tops the previous mark of $31 million set last week when left-hander David Price agreed to a $217 million, seven-year contract with Boston.

Out of the playoffs since 2011, the Diamondbacks finished 79-83 last season.