Updated

A bankruptcy judge said late Sunday that General Motors Corp. can sell the bulk of its assets to a new company, clearing the way for the automaker to quickly emerge from bankruptcy protection.

Federal Judge Robert Gerber ruled that the sale is needed to avoid "immediate and irreparable harm" to GM and is in the best interests of both the automaker and its creditors.

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, consumer groups and individuals with lawsuits against the company argued in court 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. Last month, a group of bondholders and others took their objections to Chrysler LLC's sale plan all the way to the Supreme Court, delaying the Auburn Hills, Mich.-based automaker's exit from bankruptcy protection.

GM's government-backed plan for a quick exit from Chapter 11 hinges on the sale, which will allow the automaker to leave behind many of its costs and liabilities. The Treasury Department has vowed to cut off funding to GM if the sale doesn't go through by July 10.

The Detroit car maker's Chapter 11 filing on June 1 was the fourth-largest in U.S. history.

GM will leave bankruptcy court with significantly reduced debt and labor costs, as well as fewer dealerships and brands. But it's still operating in an environment where fewer American are buying cars. At the current pace, automakers will sell around 9.7 million vehicles this year. That's a huge reduction from sales of more than 16 million vehicles as recently as 2007.

In June, the automaker captured 20.3 percent of the U.S. market. GM has estimated that it can maintain a market share between 15 and 17 percent, reflecting its plan to sell off three brands and end its Pontiac line.

GM has several new cars coming to market next year, including the Chevrolet Volt, a plug-in hybrid electric car. The Volt might be a promising vehicle, but with an expected $40,000 price tag it might only be a niche player, said James E. Schrager, clinical professor of entrepreneurship and strategy at the University of Chicago Graduate School of Business.

Upcoming small-car models such as the Chevy Cruze and Spark may fare well, but will face heavy competition from foreign automakers already in that segment of the market and from Ford Motor Co.'s new Fiesta, which the company has already started advertising.

Overall, GM's major challenge will be winning back customers who have migrated to foreign competitors. Some newer GM models have received good reviews for quality and performance, but that hasn't persuaded enough consumers to buy GM cars.

"The problem is the status of General Motors' brands," Schrager said. "They have to have some really breakthrough products that work and resonate with consumers. And they may have to slowly, over time, turn the image around."

It might be difficult to change public perception of a company that's received $50 billion in taxpayer funds. In exchange for those funds, the government will have a 60 percent ownership stake in the "new GM." The Obama administration has said it does not plan to interfere with the day-to-day running of the company, such as where to open a plant or which dealer to close. The government has been involved in the selection of the new company's 13-member board of directors and change of control transactions.

The company, in consultation with the government, named former AT&T Inc. CEO Ed Whitacre to chair the board. Whitacre is in the process of choosing four new directors.

The United Auto Workers union, which gets a 17.5 percent stake through its health care trust for retirees, has selected Stephen Girsky, a former GM adviser and Morgan Stanley analyst, to serve on the board. The Canadian government, which will control a 12.5 percent share, also will pick one member.

Fritz Henderson, who succeeded former CEO Rick Wagoner in March when the Obama administration forced Wagoner to resign, has said he expects to remain at the helm of the automaker as it comes out of bankruptcy.

Therefore it's up to him to fashion the company's strategy and management. He's already said he would cut about 34 percent of GM's executive ranks by the end of the year.

The new GM will also have fewer overall assets. Assets that GM does not sell to the new company will become part of a separate "old GM" and will be sold to the highest bidder under court supervision.

The old GM will include a smattering of properties, including 14 facilities from a stamping plant in Indianapolis to an assembly plant in Moraine, Ohio, to a powertrain facility in Fredericksburg, Va. Several of the facilities, like an assembly plant in Wilmington, Del., are already slated to be closed.

Other assets to be filed under the old GM include brands like Hummer, Saturn and Saab, for which GM has lined up buyers. They also include all current GM common stock, which -- despite its active trading on over-the-counter markets -- will soon be worthless.

Other assets include an nine-hole golf course in Clark, N.J., three warehouses in Michigan, a landfill in Framingham, Mass., and a 76-acre lot of vacant land in Van Buren Township, Mich.

Some old GM assets could prove particularly tricky to unload. One plant that will go on sale includes an aluminum casting facility in Massena, N.Y. The plant has been contaminated by PCB sludge generated from the recycling of hydraulic oil that was used in the plant's machinery, according to the EPA. Some of the waste lies below the underground water level, and the St. Regis Mohawk Tribe, whose lands border the site, filed several objections to GM's sale plan, arguing that it unfairly frees GM of its environmental responsibilities toward cleaning the site.

The old GM will remain an entity until all of the facilities are sold off, a process that could take months or years to complete.

Click here for more auto news and reviews from FOX Car Report