"We will miss her talents," Page, now Google's CEO, said in a statement.
In another statement, 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 Monday, Mayer revealed to Fortune magazine that she is pregnant with a boy. Her due date is Oct. 7. She said she had informed Yahoo's board about her pregnancy before the 11 directors unanimously voted to hire her.
Other prominent female executives in Silicon Valley include Hewlett-Packard Co. CEO Meg Whitman and another former top Google executive, Sheryl Sandberg, who defected to a rival when she joined Facebook as that company's chief operating officer in 2008. Other female CEOs running major technology companies include IBM Corp.'s Virginia "Ginni" Rometty and Xerox Corp.'s Ursula Burns.