Yahoo's stock price shot up more than 7 percent in after-hours trading Tuesday after the company released its fourth-quarter earnings and announced a plan to cash out its stake in Alibaba, the Chinese e-commerce giant, tax-free.

The Sunnyvale, California-based company said it plans to transfer its 384 million shares of Alibaba, currently valued at $40 billion, to SpinCo, a new company it will create that will be publicly traded. SpinCo's stock will then be distributed among Yahoo's shareholders, allowing Yahoo to avoid paying approximately $16 billion in taxes for its Alibaba stake. Yahoo said its plan for SpinCo will likely close in the fourth quarter of 2015. 

"Throughout my tenure with the company, we have worked tirelessly on a tax-efficient alternative that would maximize the value of our Alibaba investment for our shareholders," CEO Marissa Mayer said in a statement. "A tax-free spinoff accomplishes this and delivers value directly and exclusively to our shareholders."

The Alibaba news was enough to give Yahoo's stock a boost, which was fortunate for the company considering its advertising business was otherwise flat. Yahoo posted earnings of 30 cents per share, slightly beating analysts' expectations of 29 cents per share, while revenue came in at $1.18 billion for the quarter, just under analysts' expectations of $1.19 billion.

Although Yahoo's mobile, video, native and social advertising businesses are showing strong growth, the company's desktop display revenue was down 5 percent year-to-year, and Mayer warned that Yahoo expects display revenue to continue decreasing before the company is able to stabilize it. 

In search, Yahoo's revenue remained flat at $462 million for the quarter, but the period only included one month of Yahoo's new partnership with Mozilla that makes it the default search engine for the Firefox Web browser. When asked if Yahoo will aim to replace Google as the default search engine for Apple's Safari Web browser, Mayer said Yahoo is open to working with more partners, "particularly one with Apple’s volume and user base,” she said.

“Anyone who is in the search business needs to be interested in the Safari deal,” Mayer said.

Overall, there were no surprises in Yahoo's results, but the fact that the company feels confident enough in its core business to finally cash out its Alibaba stake is a good sign for investors, said Martin Utreras, senior forecasting analyst for eMarketer.

"They think they can grow organicailly," said Utreras. "We see that as a positive."