PHOENIX - Maricopa County and the Arizona Diamondbacks have come to an understanding in their complicated relationship over Chase Field, an announcement from the county said Wednesday.

The D-backs will play at Chase Field for at least five more seasons unless another facility is ready for play in Maricopa County in that time. The agreement said that possibility is unlikely.

READ: The full Chase Field settlement proposal

The team may also explore other options for building a stadium after that time, but there will be penalties for leaving Maricopa County before 2027.

The Diamondbacks have agreed to dismiss the lawsuit they filed last January, which argued that the county needed to spend more than $180 million on repairs and upgrades to the stadium under the 30-year leasing agreement signed when the stadium was built.

The contract still runs through 2027, as initially intended. The team is taking a larger role in maintaining the stadium and booking non-baseball events, as well, as part of the new agreement. The county's Maricopa Stadium District used to have that responsibility under the old agreement.

Meanwhile, the D-backs haven't let any of this trouble at home stop them from jumping out to the best start in franchise history.