DETROIT - The troubled battery maker A123 Systems filed for bankruptcy on Tuesday, dealing a blow to the Obama administration's program to jump-start a domestic battery industry and spur development of electric vehicles. The company's bankruptcy filing was unexpected, since it struck a deal in August to sell a majority stake to a Chinese auto parts manufacturer. That agreement, with the Wanxiang Group, provided an apparent lifeline to the company. But A123, which has received federal grant money, said the Wanxiang deal was never completed, and on Monday, it failed to make a debt payment due on $75 million it had borrowed from Wanxiang. In announcing its bankruptcy filing, A123 said it had agreed to sell its automotive assets and factories to Johnson Controls, another American battery producer that has benefited from federal assistance, in a deal it valued at $125 million. A123, based in Waltham, Mass., was once considered one of the most promising grant recipients under the administration's $2 billion stimulus program for electric car development. The Department of Energy awarded the company a $249 million grant to establish battery manufacturing operations in Michigan, although A123 had received only about $132 million of the grant before its bankruptcy. The company's failure may well become a political football in the presidential campaign, in which energy policy has been a leading topic. The Republican nominee, Mitt Romney, has repeatedly criticized President Obama for his heavy spending on green-energy programs, including a $528 million loan to Solyndra, a solar module maker that went bankrupt last year. "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," said Andrea Saul, Mr. Romney's press secretary, in a statement on Tuesday. The Energy Department defended the federal grant to A123 as one of many bipartisan efforts to support American manufacturing of lithium-ion batteries for electric cars. A department official, Dan Leistikow, said in a blog post that the administration had awarded $2 billion in grants to 29 companies involved in the electrification of vehicles, creating thousands of jobs. A123 has used about $132 million of its grant to date, plus another $6 million given in 2007 by the Bush administration, said Mr. Leistikow, the agency's director of public affairs. Michigan has also given A123 a $9 million grant, plus various tax breaks. Mr. Leistikow said the federal money would not be wasted because A123"s two Michigan factories would now be operated by Johnson Controls. "In an emerging industry, it's very common to see some firms consolidate with others as the industry grows and matures," he said. The department previously gave Johnson Controls, based in Wisconsin, its own $299 million federal grant for an electric-car battery project. The Solyndra bankruptcy, which became the subject of Congressional hearings, stoked concerns about oversight of government-backed energy programs. Another battery manufacturer that received federal help, Ener1, went bankrupt in January. It had approval for $118.5 million in grants from the Energy Department but had received only about half of that when it entered bankruptcy. A123 was a centerpiece of the government's electric-vehicle program, opening two factories in Michigan and securing contracts to supply batteries to automakers including General Motors and the start-up firm Fisker Automotive. But its financial stability has been in question for more than a year. The company suffered a major setback when it had to recall defective batteries in Fisker cars. And despite orders from carmakers, A123 could not generate sufficient revenue or profit from the slowly growing market for electric vehicles. In August, A123 surprised industry experts by agreeing to sell up to 80 percent of the company to the American arm of the Wanxiang Group, China's largest auto parts manufacturer. Political opponents of the Wanxiang deal asserted that the Chinese company would get access to technology and products made possible by the support of American taxpayers. One of the critics, Senator Charles E. Grassley, Republican of Iowa, said the sale of A123"s factories to Johnson Controls was "something positive" because it kept the company's assets out of Chinese hands. But Mr. Grassley and Senator John Thune, Republican from South Dakota, criticized the Energy Department, saying it ignored warning signs that A123 was faltering. "The bankruptcy raises the prospect that the taxpayers will get little or no return on their investment in A123 and will lose millions of dollars," Mr. Grassley said. The Energy Department countered that A123"s employees and customers would be absorbed by a larger, stronger competitor in Johnson Controls. "A123"s manufacturing facilities and technology will continue to be a vital part of America's advanced battery industry," said Mr. Leistikow. Wanxiang, which has its United States headquarters outside Chicago, pledged in August to invest up to $465 million in A123, but the deal fell apart for undisclosed reasons. "We determined not to move forward with the previously announced Wanxiang agreement as a result of unanticipated and significant challenges to its completion," said David Vieau, A123"s chief executive, in a statement. Instead, the company found a new suitor in Johnson Controls, which analysts say is now in position to be the dominant American battery manufacturer. A123 said filing for Chapter 11 bankruptcy protection would ease the sale of its automotive assets to Johnson Controls. The deal includes Michigan plants in the Detroit suburbs in Livonia and Romulus, as well as A123"s equity interest in battery facilities in China. Johnson Controls said it would provide $72.5 million in financing for A123"s reorganization in bankruptcy. "We believe that A123"s automotive capabilities are a good complement to our existing portfolio and will further advance Johnson Controls" position as a market leader in this industry," said Alex Molinaroli, head of the power systems unit of Johnson Controls. Brian Johnson, an analyst with Barclays Capital, said in a research note that the deal would help Johnson Controls become "the U.S.-based player" in the market for lithium-ion batteries. A123 has also received "significant interest" for its remaining assets, primarily its electric-grid technology and products for commercial and government entities, said Mr. Vieau, the company's chief executive Whether Wanxiang will bid on those assets during bankruptcy is not known. The head of the Chinese firm's United States operations, Pin Ni, said in an e-mail on Tuesday, "Our interest and commitment has not changed" regarding A123. Matthew L. Wald reported from Washington.