Yahoo and Alibaba have finally hashed out terms that will see Yahoo sell back half of its stake in the Chinese e-commerce site in a $7 billion deal, according to an AllThingsD report.

Yahoo will sell half of its 40 percent stake, and with Alibaba valued at $35 billion, the value of Yahoo’s holdings are worth around $7 billion. The taxable Yahoo-Alibaba deal has reportedly been cleared by Yahoo’s board. After taxes and fees, Yahoo should end up clearing about $4 billion.

Both Yahoo and Alibaba have been bickering over the terms of the relationship for years, so it only makes sense for Yahoo to finally give up a portion of its stake in the company. And Yahoo seriously needs cash to help it come up with new direction and new products, especially in light of the company losing CEO Scott Thompson recently in an embarrassing resume-padding scandal.

Photo credit: Flickr/Yahoo