A federal judge ruled General Motors was not required to pay US$450m to cover medical benefits for retirees, in a defeat for the UAW.

In a 36-page decision, US District Judge Avern Cohn in Detroit said the current GM did not assume any obligation for the payment, which the automaker had contracted to make two years before its June 2009 bankruptcy filing, Reuters reported.

The payment had been part of a June 2007 contract between the old GM, its former Delphi affiliate and the UAW.

It was not, however, included in a different contract over medical benefits signed in July 2009 by the GM that emerged from Chapter 11.

The UAW claimed that the new GM owed the money by virtue of Delphi's own emergence from bankruptcy in October 2009.

Judge Cohn, nonetheless, said the language of the 2009 contract made clear that GM did not owe the payment.

He added that US Bankruptcy Judge Robert Gerber in New York, who oversaw GM's bankruptcy, found the contract fair, reasonable and in retirees' best interests.

"Whether New GM has a moral obligation regarding the payment is another matter and not relevant," he wrote, according to Reuters. "The UAW's efforts to turn the absence of language into language is reminiscent of the efforts to capture a 'will o' the wisp.'"

The news agency could not obtain comment from relevant parties. It noted US Chapter 11 reorganisations can allow debtors to reject obligations that predate their bankruptcies.

The federal bailout of GM ended this week when the US Treasury said it had sold the last of its shares of the automaker.