Microsoft, the world's largest maker of software, plans to return more than $75bn (£40.5bn) in cash to shareholders over the next four years.
Bill Gates plans to donate his dividend to his charity
The company will begin by paying a one-off dividend worth $32bn, or $3 a share, in December this year.
The return of capital will be the biggest by a US company and comes after investors increased pressure on Microsoft to use its massive cash pile.
Chairman Bill Gates said he would give his share of the payout to charity.
Mr Gates is expected to be in line for a $3bn payout, which will go to his charitable trust, the Bill & Melinda
News of the dividend boosted Microsoft shares by more than 5% in after-hours electronic trading in New York.
Steve Ballmer, Microsoft's chief executive, said the cash return had been made possible by the reduction in legal uncertainties facing the company.
He added: "We will continue to make major investments across all our businesses and maintain our position as a leading innovator in the industry."
However, some analysts raised question marks over the outlook for future growth at a company whose software is used on more than 90% of the world's personal computers.
Microsoft has already warned that sales growth next year is likely to slow.
John Derrick, director of research at US Global Investors, said that that company's cash holdings of about $56bn may mean that "the business has matured and they are potentially running out of investment ideas".
Other analysts complained that the planned payout still meant Microsoft's dividend yield would be among the lowest of companies listed in the Dow Jones stock index.
However, the company remains in a strong position.
According to chief financial officer John Connors, even after the planned buyback and dividend payment Microsoft should still have close to $25bn in cash.
That should be more than enough for the company to keep expanding and meet its outstanding legal problems, including an antitrust fine imposed by the European Union.
The European Commission, the EU's executive arm, has fined the firm 497m euros as well as telling it to reveal software code to competitors and change the way it markets products.
Microsoft, which has already settled a number of legal battles, is appealing against the decision.
Analysts had expected Microsoft to return cash to shareholders once it had settled many of the court cases, including its antitrust battle with the US government and a host of class action lawsuits lodged by customers.
The company, which also wants to replace its annual dividend of 16 cents per share with a quarterly dividend of 8 cents, will now seek shareholder approval for its plan at an annual general meeting in November.