SAN FRANCISCO — Marissa Mayer has finally gotten what she’s wanted ever since she left Google three years ago to run Yahoo: a chance to build a new experience for searching the web and mobile phones.

Yahoo and Microsoft announced on Thursday that they had amended their 10-year search partnership to allow Yahoo to deliver its own search results and ads for up to half the searches made by visitors to Yahoo sites and apps.

Under the original agreement, struck five years ago, Yahoo was required to use Microsoft’s Bing search results and ads for all desktop searches, although it was free to use alternatives on mobile devices.

Yahoo’s one billion users will not see a new search experience immediately, and any changes will probably be gradual. The venerable Internet company, which dominated web search before the rise of Google, sold its search technology to Microsoft under the original agreement and has only a small team devoted to search now.