Updated from 1:12 a.m. EDTA federal bankruptcy judge gave U.S. automaker General Motors ( GMGMQ) the OK to sell its best assets to a new company, clearing the way for it to emerge from bankruptcy. U.S. Judge Robert Gerber said in his 95-page ruling late Sunday that the sale was in the best interests of both GM and its creditors, whom he said would otherwise get nothing. "As nobody can seriously dispute, the only alternative to an immediate sale is liquidation -- a disastrous result for GM's creditors, its employees, the suppliers who depend on GM for their own existence, and the communities in which GM operates," Gerber wrote in his ruling. The judge's order includes a four-day stay before closing of the sale can occur. However, GM said in a statement Monday it expects the sale to close in the near future. The Treasury Department has vowed to cut off funding to GM if the sale doesn't go through by Friday. The decision came after a three-day hearing that wrapped up Thursday, during which GM and government officials urged a quick approval of the sale, saying it was needed to keep the automaker from selling itself off piece by piece. But attorneys for some of GM's bondholders, unions, consumer groups and individuals with lawsuits against the company argued for its rejection, saying that their needs were being pushed aside in favor of the interests of GM and the government. It was unclear early Monday if any of those groups planed to appeal Gerber's decision. Under the deal, GM would sell its most desirable assets, including its well-known Chevrolet and Cadillac brands, to a new company owned largely by the U.S. and Canadian governments and a health care trust for the United Automobile Workers union. It's expected the new company, which will still be called General Motors, will be taken public in 2010. In its statement Monday, the automaker said the "new GM will have lower leverage and a stronger balance sheet, which when combined with a lower break-even point, will allow it to reduce its risk, operate profitably at much lower volume levels, and to reinvest in the business in the key areas of advanced technology and product development." "A healthy domestic auto industry remains vital to the global economy and we deeply appreciate the support the U.S., Canadian and Ontario governments and taxpayers have given GM, and the sacrifices that have been made by so many," said CEO Fritz Henderson, who will retain that title with the new company. "This has been an especially challenging period, and we've had to make very difficult decisions to address some of the issues that have plagued our business for decades. Now it's our responsibility to fix this business and place the company on a clear path to success without delay." The current General Motors will change its name to Motors Liquidation Co. and retained assets will be wound down or sold. GM filed for bankruptcy protection on June 1, in what was the fourth-largest bankruptcy filing in U.S. history.