Yahoo’s new owner Oath is now in a legal battle with browser company Mozilla over a search deal that was struck by former Yahoo CEO Marissa Mayer.

Last week, Yahoo Holdings and Oath filed a complaint against Mozilla, alleging that it improperly terminated an agreement between Mozilla and Yahoo. Now, Mozilla just filed a cross-complaint, claiming breach of contract.

Back in 2014 Mozilla and Yahoo struck a deal that would see Yahoo act as the default search engine in Firefox through 2019. But now, two years early, Firefox has reneged on the agreement, opting for Google instead. This seems like a shady thing to do, which is why Yahoo’s parent company Oath — which was created when owner Verizon merged Yahoo and Aol — has filed a complaint, alleging the agreement has been terminated incorrectly.

However, Mozilla claims its actions are in line with the contract that was signed at the time, which includes a clause that stipulates Yahoo must continue to make payments to Mozilla until the contract end date, even if Yahoo is no longer used as the default search engine. This problematic deal was struck by former CEO Marissa Mayer, who, in an attempt to lure Mozilla away from Google, offered the browser provider unprecedented protection in a change-of-control scenario, giving it the right to walk away from the partnership if it did not deem the new partner acceptable. Mayer was presumably under the impression it would never actually come to fruition, but Yahoo was this year bought under the Oath umbrella, and here we are.

In its response today to Oath’s suit, Mozilla posted information online, including a long statement from Mozilla legal head Denelle Dixon:

We recently exercised our contractual right to terminate our agreement with Yahoo based on a number of factors including doing what’s best for our brand, our effort to provide quality web search, and the broader content experience for our users.

Immediately following Yahoo’s acquisition, we undertook a lengthy, multi-month process to seek assurances from Yahoo and its acquirers with respect to those factors. When it became clear that continuing to use Yahoo as our default search provider would have a negative impact on all of the above, we exercised our contractual right to terminate the agreement and entered into an agreement with another provider.

The terms of our contract are clear and our post-termination rights under our contract with Yahoo should continue to be enforced. We enter into all of our relationships with a shared goal to deliver a great user experience and further the web as an open platform. No relationship should end this way — litigation doesn’t further any goals for the ecosystem. Still, we are proud of how we conducted our business and product work throughout the relationship, how we handled the termination of the agreement, and we are confident in our legal positions.

Mozilla wants Yahoo to continue making its annual payments worth around $375 million even though it’s no longer Firefox’s default search browser, as the original contract stipulates, while Yahoo says it shouldn’t have to because Mozilla isn’t playing fair and besides, the problematic deal was made by Yahoo’s former CEO and isn’t necessarily indicative of the company’s present-day vision. It’s an interesting, messy case, and one we’ll be hearing much more about in the future.

It is worth knowing that deals with search providers are big money-spinner for Mozilla, bringing in around US$300m a year and contributing around ninety per cent of the foundation’s revenue.