America's biggest carmaker, General Motors, declared itself bankrupt today in a legal filing at a federal courthouse in downtown Manhattan, kicking off the biggest industrial insolvency in US history.

GM filed for Chapter 11 protection against its creditors' demands at 8am local time after racking up losses of $81bn (£50bn) over four years, putting a veteran bankruptcy judge, Robert Gerber, in charge of the future of 235,000 employees worldwide.

Speaking in Washington a few hours after the filing, Barack Obama said the GM restructuring plan was "tough but fair". He acknowledged that General Motors stakeholders – its parts suppliers, dealers, debt-holders, shareholders, workers and retirees – were making tough sacrifices to keep the company afloat.

"I want to be honest with you: building a leaner GM will come at a cost," he said. "You will have to make a sacrifice for the next generation so that our children can grow up in an America that still makes things."

Based in Detroit, the 101-year-old company is a stalwart of the US manufacturing base, producing vehicles with brands such as Chevrolet, Cadillac, Hummer, Opel and Vauxhall. Its filing comes a month after its smaller rival Chrysler declared bankruptcy, leaving two of the top three American motor manufacturers under court protection.

GM will continue to manufacture and sell cars under bankruptcy and the US government is hoping for a swift, "surgical" process under which the company will emerge in smaller, streamlined form within 60 to 90 days.

Obama said the massive reorganisation of GM would leave the US government holding 60% of the company's equity. But it was necessary to preserve an iconic symbol of American business and maintain a viable US auto industry.

At the White House, flanked by his economic advisers and cabinet secretaries, Obama reiterated that the government was a "reluctant" shareholder in General Motors, but said the alternative – extending more loans – would burden the new company with debt and would hinder its re-emergence as a viable company.

"I recognise that this may give some Americans pause," he said. "We're making these investments not because I want to spend the American people's tax dollars but because I want to protect them."

GM is the largest industrial corporation ever to go bankrupt in the US and the third-largest bankruptcy of any sort, behind the investment bank Lehman Brothers and the telecommunications firm WorldCom.

GM's chairman, Kent Kresa, said the board had authorised bankruptcy‚ "with regret that this path proved necessary despite the best efforts of so many".

He did his best to put a positive spin on the move, describing it as a "new beginning" for the company: "A court-­supervised process and transfer of assets will enable a new GM to emerge as a stronger, healthier, more focused and nimbler company with a determination not to just survive but to excel."

Judge Gerber, who will rule on the competing claims of GM's creditors, is an old hand at high-profile insolvencies, having handled the bankruptcy of firms such as Adelphia and Global Crossing.

The carmaker has received $19bn of emergency aid from the treasury to keep it afloat and a further $30bn of government funding is likely to be forthcoming to see it through bankruptcy.

In return for its support, the Obama administration is likely to get a 60% ownership stake in the company. Canada's government, which is contributing billions of dollars in further help, will get 12.5% with unions and bondholders holding the rest.

Until it was overtaken by Toyota last year, GM was the largest carmaker in the world. But the company has been hobbled by a collapse in demand for new vehicles from the US market, where industry-wide sales of cars have dropped from 17m a year to fewer than 10m.

David Cole, chairman of the Michigan-based Center for Automotive Research, said last year's soaring fuel prices proved to be the final straw, pushing customers towards smaller, more fuel-efficient vehicles from Asian manufacturers.

"The financial meltdown in the economy has driven the auto industry into depression," he said. "We have an auto depression, not a recession."

To restore profitability, GM's chief executive, Fritz Henderson, has made it clear that cuts will need to be deep and permanent. He is selling chunks of the company dubbed "old GM", including its European operation, which employs 5,500 people making Vauxhall cars in Britain. Brands such as Saturn, Saab and Hummer are on the block and Pontiac, a sporty "muscle car" marque, is to close.

GM's US manufacturing workforce is to shrink from 113,000 three years ago to just 38,000 by 2011. Scores of factories across the US are shutting for an extended summer break and GM is slashing its network of dealership showrooms by 40%.

The extent of the government's intervention in the motor industry has alarmed business organisations. Thomas Donohue, president of the US Chamber of Commerce, warned today that GM would not prosper if it was run by the Obama administration and the United Auto Workers union.

"If members of Congress, along with government officials from the United States to Germany to Canada, are allowed undue influence over management's decisions, then you can write this down: these companies will not return to profitability and their survival will be seriously challenged," said Donohue.

Obama's auto industry taskforce had initially hoped that GM could be kept afloat without going through bankruptcy. But bondholders, who are owed $27bn by the carmaker, have been reluctant to swap their debt for a small equity stake.

Over the weekend, 54% of these bondholders indicated that they were willing to accept an improved deal under which they could eventually get up to 25% of GM, stoking optimism that the bankruptcy could proceed swiftly, without a long, drawn-out fight over assets that risked pushing the company into liquidation.

The 24-page bankruptcy filing, which gives GM's address as 300 Renaissance Centre, Detroit was lodged under the name of a Manhattan vehicle dealer, Chevrolet-Saturn of Harlem, which is owed money by the carmaker.

A list of GM's largest debtors is topped by the Wilmington Trust Company of Delaware, which represents bondholders owed $22.7bn, followed by the United Auto Workers union on behalf of employees owed $20.5bn.

Other claims include demands for money from the car rental firms Avis and Enterprise, the French advertising agency Publicis, the computer maker Hewlett-Packard, the oil firm Exxon Mobil and Lakshmi Mittal's steel corporation, Arcelor Mittal.