United Airlines parent UAL Corp. (search) and the union representing their mechanics reached a tentative labor deal Friday that may help the airline win the cost savings it needs to exit bankruptcy, a UAL attorney said in bankruptcy court.

UAL said it reached a tentative deal with the Aircraft Mechanics Fraternal Association (search) and it hoped to reach agreement with the Association of Flight Attendants (search) this weekend.

Details of the negotiations were not immediately available. Any deals will require ratification by the airline's union members as well as approval by the court.

Earlier Friday, Bankruptcy Judge Eugene Wedoff rejected an agreement between Elk Grove Village, Illinois-based United and its pilots union, the Air Line Pilots Association (search), saying it "unfairly tilted the bankruptcy process" in favor of the pilots.

The ruling sent UAL and ALPA back to the bargaining table to hammer out a new deal. The two parties have said they will work together in the coming days to reach an agreement.

United also has tentative deals with two other unions — the Professional Airline Flight Control Association (search) and the Transport Workers Union (search).

The carrier had asked Wedoff for permission to end its collective bargaining agreements with the unions if it failed to achieve $725 million in annual savings from its work force by mid-January. That amount comes on top of $2.56 billion in concessions the unions have already provided.

Part of what must still be decided upon is the treatment of the companies pension plans. The deal with the pilots would have allowed the plans to be terminated for other financial considerations.

"We still believe we need to terminate and replace all 4 of our defined benefit plans," said UAL Chief Financial Officer Jake Brace on Friday afternoon.