General Motors has headed off a potentially divisive proxy fight by agreeing to buy back $5 billion in stock by the end of next year.

The move announced Monday is part of a deal with Harry Wilson, a former member of the government task force that restructured GM coming out of its 2009 bankruptcy. In exchange, Wilson agreed to withdraw his hostile candidacy for the Detroit automaker's board of directors.

Wilson had accused GM of hoarding cash to the detriment of shareholders and had sought an $8 billion buyback.

GM, which had $25.2 billion in cash at the end of last year, now says it will maintain a cash balance of $20 million and aim to keep its investment-grade status.

The share repurchase will begin immediately and finish before the end of 2016. Investors appeared to like the announcement. GM shares rose $1.01, or 2.7 percent, to $37.85 in premarket trading Monday.

Negotiations with Wilson's group had been going on for about two weeks and culminated during the weekend, CEO Mary Barra said Monday. She wouldn't say much about the talks or whether Wilson was resistant to a smaller stock buyback than initially demanded. The company also talked with other major shareholders, who agreed with the buyback, she said.

Barra indicated that the buyback might have come without Wilson's prodding. "We were on a path to do this anyway," she said Monday.

GM announced a 20 percent dividend increase when it released fourth-quarter and full-year numbers last month, and Chief Financial Officer Chuck Stevens said further returns to shareholders were under consideration for the second half of the year. Combined, the two moves will cost the company $10 billion by the end of 2016.

Stevens said Monday that the $20 billion cash reserve is high enough for GM to withstand the costs of its ignition switch recall and any potential economic downturn. The company, he said, had always stated that it planned to keep a $20 billion to $25 billion reserve. Because of efficiencies and cost cuts, the company could look at drawing that down even further, he said.

He said he did not expect credit rating agencies to change their outlook on GM.

Also Monday, GM said it would return capital to shareholders each year and said it will announce those plans each January. It also reiterated plans to invest more than $9 billion in the company this year to roll out more new vehicles in the coming years.

Wilson, 43, filed notice of his board candidacy on Feb. 9 in a letter to Barra. He represents four hedge funds — Taconic Parties, Appaloosa Parties, HG Vora Parties and Hayman Parties — which own 34.4 million GM shares, about 2.1 percent of the company.

Under a deal with the funds, Wilson would get up to 4 percent of any profits they made on GM stock.

"We arrived at a win-win outcome that includes a thoughtful approach to critical capital allocation issues," Wilson said in a statement issued by GM.

In an interview with The Associated Press last month, Wilson said shareholders are frustrated with GM because it's an underperforming company with substantial cash that needs help reaching its potential. "They are not a very good steward of capital," Wilson said.

Before a jump in the stock price after raising the dividend in early February, GM "had not generated a dollar of net value for shareholders," Wilson said. GM shares were trading around $33, about the same price as its post-bankruptcy public offering in November of 2010, he said.

The company, he said, has not improved its profit margins appreciably, and is behind other automakers in working with parts supply companies to develop more models off fewer car and truck architectures.

GM restored its quarterly dividend in January of 2014 for the first time in six years. In early February the company announced it would raise the dividend 20 percent in the second quarter to 36 cents, pending board approval.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

GM faces uncertainty in several areas that could drain its cash stockpile. The Justice Department is investigating the company for failing to disclose a deadly ignition switch problem in its small cars to government safety regulators. That penalty could be as much or more than the $1.2 billion that Toyota paid in a similar case. The switches are responsible for at least 57 deaths, and GM has committed to making payments to those injured and families of those who were killed. The company has set aside $400 million for the payments but says they could go as high as $600 million.

Like other Detroit automakers, GM also faces the financial uncertainty of contract talks with the United Auto Workers union later this year.