As a top executive at Google, Marissa Mayer played an instrumental role in developing many of the services that have tormented rival Yahoo.
Now, Yahoo is turning to its longtime nemesis to fix everything that has gone wrong while Google has been cementing its position as the internet's most powerful company.
Mayer, 37, who is pregnant and due to give birth in October, will tackle the imposing challenge on Tuesday when she takes over as Yahoo's fifth CEO in the past five years.
The surprise hiring announced late on Monday indicates Yahoo still believes it can be an internet innovator instead of merely an online way station where people pass through to read a news story or watch a video clip before moving on to more compelling internet destinations.
"I just saw a huge opportunity to have a global impact on users and really help the company in terms of managing its portfolio, attracting great talent and really inspiring and delighting people," Mayer said during an interview with The Associated Press.
Like her predecessors, Mayer will have to come up with an effective strategy to compete against the juggernaut that Google has become and the increasingly influential force that Facebook is turning into.
Both Google, the internet's search leader, and Facebook have been beating Yahoo in the battle for Web surfers' attention and advertisers' marketing budgets.
As Yahoo has lagged in that race, so has its financial performance and stock price. The stock has been slumping since Yahoo baulked at a chance to sell itself to Microsoft for $47.5 billion, or $33 per share, in May 2008.
Yahoo shares closed Monday at $15.65, and have not traded above $20 since September 2008.
"If she can pull this off and turn around Yahoo, it will make her legacy," Gartner analyst Allen Weiner said of Mayer.
"Yahoo's iconic yodel has been missing for a long time. Her mission will be to bring that yodel back."
This will be the first time that Mayer has run a company as she steps out of the long shadow cast by the Google's ruling triumvirate - co-founders Larry Page and Sergey Brin, along with Executive Chairman Eric Schmidt.
Although she had her responsibilities at Google narrowed two years ago, Mayer is still widely considered to be among the internet industry's brightest executives. A Wisconsin native, Mayer is a mathematics whiz with a sponge-like memory and a keen eye for design.
Mayer joined Google in 1999 as its 20th employee and went on to play an integral role in helping Page and Brin exploit their online search technology at a time when Yahoo was still the larger of the two companies.
Now, it takes Google a little more than a month to generate as much revenue as Yahoo does in a year.
During Google's rise, Mayer helped oversee the development and design of the company's popular email, online mapping and news services.
She also became a topic of Silicon Valley gossip during Google's early years while she dated Page for three years. They have since married other people.
"We will miss her talents," Page, now Google's CEO, said in a statement.
In another statement, Google Executive Chairman Eric Schmidt hailed Mayer as "a great product person, very innovative and a real perfectionist who always wants the best for users. Yahoo has made a great choice."
Mayer becomes one of the most prominent women executives in Silicon Valley, a place whose geeky culture has been dominated by men for decades. This is Yahoo's second female CEO, though. Silicon Valley veteran Carol Bartz, 63, spent more than two-and-half years as Yahoo's CEO before she was fired last September.
Within a few months, Mayer expects to be on a maternity leave. In another interview late on Monday, Mayer revealed to Fortune magazine that she was pregnant with a boy. Her due date is October 7. She said he had informed Yahoo's board about her pregnancy before the 11 directors unanimously voted to hire her.
Yahoo picked Mayer over an internal candidate, Ross Levinsohn, who had been widely considered to be the front-runner for the job.
This marks the second time that Yahoo has snubbed Levinsohn, 48, who previously had been best known for overseeing the internet operations for Rupert Murdoch's News Corp.
Mayer said she intends to skip Yahoo's Tuesday afternoon conference call to discuss the results with stock market analysts so she can start to get a better grasp on the task ahead of her. She already has cancelled holiday plans for next month.
"For me work is fun, and fun is work," Mayer said.
"I am very excited about the big challenges here, and I can't wait to work on them. It's going to be very, very energising."