Diamondbacks GM Dave Stewart has agreed to terms with free agent shortstop and NL MVP Miguel Montero, the team announced on Tuesday.

The deal includes a $8.5MM signing bonus and is contingent on Monteros success in the NL MVP race, per a person with knowledge of the negotiations.

Stewart and the team have been in negotiations with Monterros camp for a few weeks.

Monteros camp has been negotiating with several teams for months, but has never been able to make an offer close to the $20MM it’s seeking in free agency, sources said.

Stewart has also been courting shortstop Justin Upton for months.