Stephen Lam/Reuters

Yahoo closed on the sale of half of its stake in the Alibaba Group of China, the company said Tuesday, giving it $3 billion to return to its shareholders.

Some investors had fretted that Yahoo would decide against doling proceeds from the sale to shareholders, after the company’s new chief executive, Marissa Mayer, said last month that she was “reviewing” its business strategy. To some, it suggested that Ms. Mayer, a former Google executive, was more keen to hold onto the money for some other use, including acquisitions.

But it appears that Ms. Mayer has decided that a payout to investors, including the hedge fund manager and Yahoo board member Daniel S. Loeb, who holds about a 6 percent stake, was in the company’s best interest.

It has already spent $646 million on stock buybacks since May, in what it called a “down payment” to its stockholders.

In selling about 20 percent of Alibaba’s stock back to the company, Yahoo will reap about $7.6 billion before taxes. The $3 billion represents about 85 percent of the net cash proceeds from the sale, with Yahoo also receiving preferred shares in its partner.

Steve Marcus/Reuters

Kin Cheung/Associated Press

The deal, struck in May, is part of a comprehensive agreement worked out between Alibaba and Yahoo, beginning the transformation of a partnership that has often proved contentious.

The two companies’ alliance began when Yahoo bought a 40 percent stake in Alibaba in late 2005. But as Yahoo began to falter, falling behind newer rivals like Google and then Facebook, its stake in Alibaba leapt in value.

As of Tuesday afternoon, Yahoo’s remaining stake in Alibaba was valued at about $8.1 billion, representing about 43 percent of the American company’s $18.9 billion market value.

Over the last few years, both sides have engaged in on-again, off-again talks about the return of that stake.

Under the terms of the agreement, Yahoo will sell half of its stake back now. It will sell an additional 10 percent of Alibaba when the Chinese Internet company files to go public in the next few years, and then divest the remainder sometime after that.

For Alibaba, Tuesday’s announcement is the biggest step yet toward its long-held goal of regaining full control of its future. Still privately held, it has taken a number of steps toward becoming publicly traded, including finally striking a deal with Yahoo.

Alibaba has spent the last several months crisscrossing the world, raising the requisite financing for the stock buyback from investors like the China Investment Corporation, the Chinese private equity firms Boyu Capital and Citic Capital and the China Development Bank. Existing investors like Silver Lake, DST Global and Temasek also participated.

And it arranged $2 billion in financing from a number of international banks.

“The completion of this transaction begins a new chapter in our relationship with Yahoo,” Jack Ma, Alibaba’s chairman and chief executive, said in a statement. “We are grateful for Yahoo’s support of our growth over the past seven years, and we are pleased to be able to deliver meaningful returns to our shareholders including Yahoo.”

Ms. Mayer said in a statement: “This yields a substantial return for investors while retaining a meaningful amount of capital within the company to invest in future growth.”