The city invested $5.2 million in a company that was supposed to be a game-changer in manufacturing by creating 500 jobs and supporting 200 small businesses out of the Brooklyn Army Terminal.

The company certainly changed the game, but not in the way the city intended — it went bust within two weeks of launching the new venture late last year.

Even by government standards, the collapse was astonishing in its swiftness.

The city’s Economic Development Corp., which had been working on the deal since 2016, issued a press release on Oct. 19, 2017 saying the do-it-yourself firm TechShop would open a 20,500-square-foot space in Brooklyn on Oct. 30, 2017 as the “cornerstone” of a new manufacturing initiative.

On Nov. 15, the company announced it was closing all 10 of its sites nationwide and would file for bankruptcy.

Records show the EDC has now hired a lawyer in California to review the bankruptcy filing.

The EDC said Tuesday that it was aware TechShop was facing financial issues in other cities, but insisted the Brooklyn operation appeared to be on solid footing.

“TechShop had some localized real-estate issues in other cities, but the Brooklyn location operated under a different business model of previous locations, and their financials showed no red flags,” the agency said.

Signs of TechShop’s fiscal distress were readily available.

In September 2016, the San Jose Mercury News wrote about a $1 million capital shortage the company was facing in a proposed move of its flagship facility to a site in the city.

When it was first reported that a deal with the EDC was pending in November 2016, company officials weren’t shy about admitting that they couldn’t afford to go to Brooklyn without subsidies.

“It’s unbelievably helpful — it’s the whole reason we’re gonna be there,” TechShop spokesman Michael Catterlin told The Brooklyn Paper at the time. “We’ve never had the capital to make [the move to Brooklyn] a success.”

CEO Dan Woods conceded last year that financial issues had been brewing at the firm for a while.

“I’m not going to spin this. We’ve been operating on exceedingly low cash balances for quite some time now,” he said in a statement on Nov. 15, 2017, announcing a total shutdown.

But before the company went bust, city officials could barely contain their enthusiasm about a plan to have small firms use TechShop’s high-tech manufacturing tools.

“The facility is the cornerstone of NYCEDC’s Futureworks NYC initiative, aimed at growing the advanced manufacturing sector, and a major component of [the city’s] 21st Century Industrial ­Action Plan,” EDC said in the statement.

Asked about the stunning turn of events, the EDC tried to put a happy face on the fiasco by saying the agency lined up a new nonprofit operator for the space — starting in 2019.

Woods and the firm’s Chapter 7 trustee didn’t respond to requests for comment.