Search engine titans Yahoo and Google have teamed up in a partnership that allows Google to power Yahoo searches with ads that will run over that company’s desktop and mobile platforms. Yahoo, meanwhile, will have the ability to use Google’s search engine for word or image queries.

The deal, revealed Tuesday in a Yahoo regulatory filing, lets Google provide Yahoo with search advertisements through that company’s AdSense for Search service. Google will then pay Yahoo a percentage of revenues from ads that run on Yahoo’s desktop and mobile platforms. Yahoo, in turn, will pay Google for its ability to use that search engine’s word or image search capabilities over Yahoo’s platforms.

Yahoo will be allowed to choose which search queries it directs to Google, and will not be obligated to a minimum number of queries. In a statement issued regarding its recent third-quarter results, the company said the deal “provides Yahoo with additional flexibility to choose among suppliers of search results and ads.”

Yahoo currently retains a similar deal with Microsoft through its Bing search engine. That deal has been in place since 2009.

The agreement, the financial details of which were not revealed, is currently slated to run for three years. A review from the Justice Department is pending.

The news comes at a good time for Yahoo. The Sunnyvale, CA based search company on Tuesday posted a revenue increase of 6.4 percent for its third-quarter — to $1.23 billion — which was lower than analyst expectations. The Wall Street Journal on Tuesday reported that shares are down 16% at the company from the year prior.

“Our Q3 results were largely within our forecasted expectations,” said Yahoo CEO Marissa Mayer in an earnings statement. “As we move into 2016, we will work to narrow our strategy, focusing on fewer products with higher quality to achieve improved growth and profitability.”

Google currently comprises more than 60 percent of all search engine queries made in the U.S., while Yahoo accounts for about 13 percent, according to data from ComScore.