Google has agreed to provide some search results and search-based ads to Yahoo.

Under the services agreement, which lasts until the end of 2018, Google will provide Yahoo with search advertisements via its AdSense for Search service (AFS), web algorithmic search services through its Websearch Service, and image search services.

Yahoo can display the results on both desktop and mobile platforms. The company may use Google’s services on its owned and operated properties as well as on several syndication partner properties in various countries.

Yahoo will be allowed to decide which search queries to send to Google and will not have to meet a minimum requirement of queries.

The deals enables Yahoo to use any other search advertising services, including its own service, the services of Microsoft or other third parties.

Google will pay Yahoo a percentage of the gross revenues from AFS ads displayed on Yahoo properties or affiliate sites.

Yahoo has been struggling to increase revenue from ad sales due to stiff competition from Facebook and Google.

The company included the Google agreement in its third-quarter results statement. GAAP revenue increased 6.8% to $1.22bn in Q3 and net income declined to $76m.