A green energy manufacturer that got $129 million in government stimulus money filed for bankruptcy protection on Tuesday and quickly sold its automotive assets to another U.S. company.

A123 Systems, an electric vehicle battery maker based in Waltham-Mass., announced that Fortune 500 company Johnson Controls will buy the company's automotive business for $125 million. It was previously thought that the company would hand over control to Wanxiang Group, a Chinese firm, which agreed in a tentative deal last August to invest up to $450 million in exchange for taking over 80 percent of the company. Some analysts had predicted that the manufacturer would be forced to move its plants to China.

"We believe the asset purchase agreement with Johnson Controls, coupled with a Chapter 11 filing, is in the best interests of A123 and its stakeholders at this time," David Vieau , chief executive officer of A123, said in a written statement. "We determined not to move forward with the previously announced Wanxiang agreement as a result of unanticipated and significant challenges to its completion."

A123 Systems was approved for a $241.1-million grant from the Obama administration three years ago and more than $125 million in Michigan tax credits in the hopes that it would create jobs and lead the country away from conventional gas-guzzling vehicles and toward clean energy. The company has drawn about $129 million of the federal grant so far. Since 2009, the company has lost a reported $857 million, laid off workers and recalled its products. A123's stock price has plunged from $4.44 about a year ago to 6 cents Tuesday morning.

On Tuesday, the Obama administration and the Mitt Romney campaign offered two drastically different views on the bankrupt manufacturer and its sale to a major U.S. company.

"A123, which has been building batteries for electric vehicles as well as for the nation's power grid, quickly established itself as an innovative player in the market. Today’s news means that A123’s manufacturing facilities and technology will continue to be a vital part of America’s advanced battery industry," Department of Energy spokesman Dan Leistikow said in a statement.

But a spokesman for Romney described the news as a failure, saying the administration wasted stimulus money on a company that is now bankrupt.

"A123’s bankruptcy is yet another failure for the president’s disastrous strategy of gambling away billions of taxpayer dollars on a strategy of government-led growth that simply does not work," Romney spokeswoman Andrea Saul told FoxNews.com.

The moves came one day after the company warned it likely would miss debt payments and could be headed for restructuring under Chapter 11.

A123 has struggled for several years as Americans have been slow to embrace electric cars. The company has yet to post a profit and lost $83 million in the second quarter. Just two months ago, A123 announced a $450 million lifeline from Chinese auto parts maker Wanxiang Group Corp., but A123 said in a statement that the deal has been scrapped.

A123 was once touted by Obama as a great example of "what's possible in a clean energy economy."

"Truth be told, A123 was looking to build that factory in Asia. But because it received that grant, it chose the state of Michigan for its largest and most innovative plant yet," Obama told reporters at an April 30, 2010, press conference.

"And that plant will be one of 30 new plants to go fully operational over the next six years, manufacturing electric vehicle batteries and components right here in the United States of America.

"So this is what's possible in a clean energy economy," the president said.

In 2009, the company also received support from several Republicans, including former Rep. Pete Hoekstra, Rep. Fred Upton and Rep. Mike Rogers, members of the Michigan Congressional delegation.

A123's stock, which traded for more than $20 on the day of its initial public offering in 2009, fell to 6 cents in late morning trading. The stock closed Monday at 24 cents.

Using its federal stimulus grant, the company set up manufacturing operations in the Detroit suburbs of Livonia and Romulus, Mich. The company has contracts to make batteries for General Motors Co., BMW AG, Fisker Automotive and others.

Unlike a loan, the company's $249 million government grant does not have to be repaid. A123 had to match the grant money as it was used. So far the company has drawn about $129 million of the grant, spokesman Dan Borgasano said Tuesday.

Johnson Controls will get A123's automotive assets, including lithium-ion battery technology, products and customer contacts. It will also take over the factories in Michigan, cathode ray factories in China and an equity interest in a Chinese battery company.

A123 also said it is in talks to sell its grid, commercial, government and other operations that weren't purchased by Johnson Controls.

Subsidiaries outside the U.S. were not included in the bankruptcy filing.

FoxNews.com's Cristina Corbin and the Associated Press contributed to this report.