It was revealed on Monday that Yahoo (NASDAQ: YHOO) has reached a deal with China's Alibaba to sell back its 40% stake back to the Hangzhou-based internet company for $7.1 billion.

Yahoo will be delighted to see some hard cash in its accounts after suffering through a particularly difficult few months and has lost 65% of its value since its 2006 peak.

While other web-based companies like Google (NASDAQ: GOOG), Amazon (NASDAQ: AMZN) and Facebook (NASDAQ: FB) have largely succeeded by expanding their businesses into new areas and innovating, Yahoo has struggled doe to an apparent inability to do the same thing. The company has remained static, and many people don't know what they do anymore, besides own a search engine and email platform that is inferior to Google in just about every way.

Whichever way you look at it though, the Alibaba deal was a good bit of business for YHOO, who paid $1 billion for the 40% stake back in 2005. The two companies may not have always agreed about everything, occasionally airing their dirty laundry in public, but a $6.1 billion return on that investment has got to be something to smile about.

The two companies fundamentally disagreed about Airplay, which used to be Alibaba's online payments business until Ma spun it out two years ago, a move that angered Yahoo. That scuffle went on for months before a settlement was reached in July. Now, with this new deal, the fights should be ended, at least for now.

YHOO interim CEO Ross Levinsohn said of the agreement that, "Today's agreement provides clarity for our shareholders on a substantial component of Yahoo!'s value and reaffirms the significance of our relationship with Alibaba."

Meanwhile, Alibaba CEO Jack Ma poured fuel on the rumors that his company might be interested in buying Yahoo in the future. "This transaction opens a new chapter in our relationship with Yahoo."

The deal will see Yahoo get $6.3 billion in cash and up to $800 million in newly issues Alibaba preferred stock. That is still a great return for Yahoo, whose shareholders will surely be a lot happier at the start of this week.

"We look forward to delivering the proceeds of the near-term transaction to our shareholders, and to the further enhancement of value and the additional monetization in the future that this agreement enables," said Yahoo CFO Timothy R. Morse.

Follow me @BCallwood.