Yahoo surprised Silicon Valley and showbiz on Monday by naming Google exec Marissa Mayer as its new prexy-CEO.

Mayer had not been seen as a candidate for the post, which opened up in May when Scott Thompson was forced to resign after only a few months at the helm amid questions about the accuracy of his claim to have an advanced degree in computer science.

The CEO post had been widely expected to be filled by Ross Levinsohn, who was named interim CEO after Thompson’s hasty exit. Levinsohn, a News Corp. alum, had been exec veep overseeing all operations in the Americas.

Mayer has been a major player at Google from its earliest days (she was employee No. 20 and its first female engineer when she joined in 1999). She most recently oversee the search giant’s Local, Maps, and Location Services wing, encompassing its suite of local and geographical products including Google Maps, Google Earth, Zagat, Street View, and local search, for desktop and mobile. She’s credited with spearheading many of the company’s innovations and creating much of the look and feel of Google’s user experience.

Mayer’s prominence at Google also gave her a profile in the media and entertainment biz. She was recently appointed to the board of directors for Walmart.

“Marissa is a well-known, visionary leader in user experience and product design and one of Silicon Valley’s most exciting strategists in technology development,” said Yahoo co-founder David Filo in announcing her appointment as chief exec and to Yahoo’s board of directors.

“Yahoo!’s products will continue to enhance our partnerships with advertisers, technology and media companies, while inspiring and delighting our users. There is a lot to do and I can’t wait to get started,” Mayer said in a statement.

Mayer joins Yahoo at a turbulent time for the Internet pioneer, which has been losing market share and ad revenue to Google and other rivals. It’s also faced a revolving door of CEOs for the past few years. Thompson’s five-month tenure was preceded by the rocky 2 1/2-year run of Carol Bartz. Before Bartz, Yahoo co-founder Jerry Yang held the reins for about 18 months following the departure of former Warner Bros. co-chief Terry Semel.

Prior to joining Google, Marissa worked at the UBS research lab in Zurich and at SRI Intl. in Menlo Park, Calif.