General Motors Corp and the United Auto Workers have reached an agreement on contract changes and restructuring $20 billion in debt owed to a trust fund for retiree healthcare, the union said on Thursday.

The tentative agreement, which was reached after a round of intensive talks involving representatives of the U.S. Treasury, will now go to a ratification vote by UAW-represented workers.

Details of the agreement were being withheld until GM workers are briefed on the proposed new contract, the union said in a statement.

A deal between GM and the UAW was one of the key obstacles for the automaker to clear before a June 1 deadline for the company to restructure its debt as part of a process widely expected to include a bankruptcy filing.

By winning a new labor deal with the consent of its major union and the Obama administration, GM is in a position 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. 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, said Scott Peltz, managing director at accounting and consulting firm RSM McGladrey in Chicago.

GM has offered bondholders with $27 billion in its debt a 10-percent stake in the reorganized company. Bondhdolders 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 in the debt exchange.

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.

GM has offered the U.S. Treasury a majority stake in a restructured company. The UAW would get 39 percent while existing shareholders would be left with a 1-percent ownership stake.

(Additional reporting by Poornima Gupta and Soyoung Kim)