The only viable option to save General Motors Corp is a sale of its main assets to a New GM backed by the federal government, a U.S. Treasury official told a bankruptcy court on Wednesday as the automaker sought approval for the deal.

The official, Harry Wilson, also said the government would withdraw its portion of the $33 billion debtor-in-possession financing for GM if the sale of the main assets did not close by the government's July 10 deadline.

GM was in the second day of a bankruptcy court hearing in Manhattan in which it is asking Judge Robert Gerber to approve its asset sales, just one month after filing for Chapter 11 bankruptcy.

At the beginning of the hearing, lawyers for a group of dissenting bondholders asked GM restructuring adviser Bill Repko, of the investment bank Evercore, and Wilson, a senior member of the Obama administration's autos task force, whether GM could have pursued a traditional reorganization rather than a speedy sale of its assets to New GM.

There was a constant dialogue in thinking through our options, Wilson said, but the government concluded that a sale was the only viable path forward for the company.

We could not find any reasonable measure of opinion from anyone ... who felt that General Motors could survive a traditional Chapter 11, Wilson told the court.

He testified that last December the government was effectively the lender of last resort for GM, which gave it significant leverage over the automaker's restructuring. He said the government wants GM to stay in bankruptcy for only 30 to 40 days.

Wilson estimated that GM has received $10 billion in funding since its bankruptcy filing. The U.S. government provided the bulk of the funding, with about 15 percent coming from the Canadian government, he said.

Under questioning from a lawyer representing personal injury claimants, Wilson said the government did feel obliged to take on liability claims if they prevented New GM from being viable.

A successful sale of GM's main assets would be the second big victory for the Obama administration's autos task force. Earlier this month it helped broker the sale of Chrysler LLC to a group led by Italy's Fiat SpA . The U.S. Supreme Court cleared the way for that deal to go through on June 9.

If the GM deal is approved, the company will be able to sell its best assets, including Chevrolet and Cadillac, under Section 363 of the bankruptcy code to New GM. The U.S. Treasury would provide $60 billion in financing to New GM, including a proposed $50 billion that would give the U.S. Treasury a 60 percent stake in the company.

Under the government-backed plan, the United Auto Workers union would gain a 17.5 percent stake in New GM, the Canadian government would own about 12 percent, and GM bondholders are expected to get about 10 percent.

GM's old assets would remain behind in bankruptcy court to be liquidated.

No competing bidders have emerged as an alternative to the U.S. government's plan for the automaker.

The case is In re: General Motors Corp, U.S. Bankruptcy Court, Southern District of New York, No. 09-50026.

(Reporting by Emily Chasan and Phil Wahba; editing by John Wallace)