General Motors Corp cleared a key obstacle in its restructuring on Thursday as the United Auto Workers agreed to cut labor costs and accept new terms for a $20 billion union retiree healthcare obligation.

Shares of the U.S. automaker rose 32 percent after the UAW announced the agreement with GM and the U.S. Treasury, prompting Standard & Poor's equity analysts to repeat a strong sell on the stock, saying bankruptcy was still likely.

The UAW deal would give embattled GM a blueprint for concessions that could be carried into a bankruptcy filing that analysts expect could come by the end of May or early June.

The tentative agreement was reached after a round of intensive talks involving representatives of the Treasury.

GM's roughly 54,000 UAW-represented U.S. factory workers are expected to vote on the agreement next week.

Details of the agreement are being withheld until workers are briefed on the proposed changes to its 2007 contract, the union said in a statement.

An Obama administration official called the agreement a positive development in GM's effort to restructure but would not comment on details.

STEP FORWARD

A deal between GM and the UAW was one of the key steps the automaker needed to take before a June 1 restructuring deadline set by the Obama administration.

It's really positive that they got an agreement. I know it was very tough. I know that they (UAW) are satisfied, Senator Debbie Stabenow of Michigan told Reuters.

While the union deal is a major move forward, the automaker and holders of $27 billion of bonds remain far apart on an agreement on how to restructure that debt.

The new labor deal puts GM in position to take a plan for creditor concessions into a bankruptcy filing even if it fails to win support from bondholders, analysts said.

I'm convinced that they have no choice but to file bankruptcy, said Scott Peltz, managing director at accounting and consulting firm RSM McGladrey in Chicago.

To the extent that you have constituencies with whom you've made an agreement prior to filing, it makes the outcome that much easier to achieve, he said.

The UAW had objected to an element of GM's restructuring that would have cut 21,000 U.S. factory jobs even as GM pressed ahead with plans to import small cars from China.

Chief Executive Fritz Henderson said GM was willing to reconsider that plan heading into the latest round of talks.

The tentative contract agreement reached in Detroit on Thursday came two days after Henderson and UAW President Ron Gettelfinger joined President Barack Obama to show their support for sharply higher fuel-efficiency standards.

Henderson, Gettelfinger and a cadre of aides reached the proposed deal after a round of intensive talks, people briefed on the closed-door discussions said.

FOCUS ON BOND DEBT

The talks focused in their final stage on how many UAW jobs would be lost to plant closures and how GM would fund its $20 billion obligation to a UAW-aligned trust known as a Voluntary Employee Beneficiary Association, according to sources familiar with the talks but were not authorized to discuss them.

GM has offered bondholders with $27 billion of its debt a 10 percent stake in the reorganized company. Bondholders have until the end of Tuesday to accept that offer.

The embattled automaker has indicated that it would likely file for bankruptcy unless about $24 billion in that bond debt -- or 90 percent of the total -- is extinguished.

I think the bond exchange that's on the table right now is dead on arrival, so unless the deal is somehow sweetened, then there's no way they're going to get the 90 percent approval that they need, said Pete Hastings, a fixed-income analyst at Morgan Keegan in Memphis.

All this is just positioning, in my view, for the bankruptcy filing that we expect to happen in the relatively near future, Hastings said.

Representatives of GM bondholders, like the secured debt holders in the Chrysler bankruptcy, have argued that the Obama administration's autos task force is rewriting the rules of corporate reorganization on the fly in a way that favors the union over other creditors.

The UAW is owed about $20 billion more from GM to fund the VEBA trust. GM had asked the union to accept equity in exchange for half of that obligation.

Bondholders have complained that the union, which was offered 39 percent of a new GM, was getting an unfairly rich payout compared with other unsecured creditors.

GM has offered the U.S. Treasury a majority stake in a restructured company. Existing shareholders would be left with a 1 percent ownership stake.

GM shares rose 47 cents, or 32.4 percent, to $1.92.

The company has warned that its shares could be worthless in bankruptcy and has said they would be worth less than 2 cents if it issued 60 billion new shares to pay off creditors.

GM's 8.375 percent bonds due in 2033 rose to 5.06 cents on the dollar after the GM-UAW announcement, up from 4.5 cents on Wednesday, according to MarketAxess.

(Additional reporting by Poornima Gupta, Soyoung Kim, Caroline Humer, John Crawley and Dena Aubin; editing by Patrick Fitzgibbons, Matthew Lewis and Ted Kerr)