President Obama tours a Saft America battery plant on Friday in Jacksonville, Fla. (Jim Watson/AFP/Getty Images)

The lithium-ion battery plant that President Obama visited Friday is a case study in the difficulty of stimulating the U.S. economy and creating jobs in an era of rapid technological change.

Obama, seeking to cement his legacy and rally popular support, held up the plant as a model of how the economic stimulus legislation he fought for seven years ago helped pull the economy back from an abyss. He credited stimulus money with encouraging the construction of the Jacksonville plant, creating jobs and contributing to American leadership in clean-energy technology.

“We took an empty swamp and turned it into an engine of innovation,” he said to plant workers Friday after he had looked at some of the robotic arms and carts that move battery components around the facility.

But the story of the sleek, modern 235,000-square-foot manufacturing plant is more ­nuanced than that. Parts of the facility, owned by Saft America, are idle. Though management originally forecast profits as early as 2013, the plant is still losing money as it vies for more of the battery market. And the French parent company, Saft Group, recently wrote down the value of the factory.

“We are frustrated as well,” Ghislain Lescuyer, Saft’s chief executive, told an analyst in a conference call on Feb. 19.

He said: “If we are realistic, I’m not pessimistic about Jacksonville. We have a huge factory which is really outstanding.” But breaking even “will take a few years,” he added.

The legacy of the stimulus is a hot political issue this year. The White House believes that Americans have forgotten just how precarious the economy was in 2009 and has been holding a series of events to remind them of the $787 billion stimulus package that Obama backed — and of the ­Republican opposition. Obama believes that doing so will burnish his reputation and boost Democrats’ electoral prospects this year, senior administration officials said.

The Saft story started in 2009 when, after competitive bidding, the Energy Department awarded the company $95.5 million under the American Recovery and Re­investment Act to help build a lithium-ion battery plant on the outskirts of Jacksonville. The company also got state and local tax breaks, but Saft put up half the money.

At the time, Obama was predicting that there would be 1 million electric cars on the road by 2015, providing a market for the batteries. When the plant was finished in 2011, Steven Chu, then secretary of energy, praised it for “powering the next generation of energy-saving electric cars and trucks” and reducing U.S. dependence on foreign oil.

Today, however, there are only about 400,000 electric and plug-in electric vehicles on the road, according to Bloomberg New Energy Finance, and competition among makers of vehicle batteries is fierce. With gasoline prices low and new electric vehicle models still down the road, sales of electric vehicles actually fell slightly in 2015, to 114,000, Bloomberg said.

“The EV space was expected to grow many-fold each year, and it has,” said Ravi Manghani, senior analyst for energy storage at GTM Research. “But the pace at which that market has grown is definitely slower than the rate at which these companies brought their products online.”

In 2009, Obama repeatedly ­lamented that the United States manufactured only 2 percent of the world’s advanced batteries. Dan Utech, deputy assistant to the president for energy and climate change, says the figure has climbed to 20 percent.

Where are they going? Most of the batteries Saft sells go to electric utilities, which use them to back up wind and solar plants and to stabilize the grid. That wasn’t foreseen in 2009. Saft recently won a contract to supply an energy-storage system to stabilize the Kauai Island electrical grid in Hawaii, where the utility is ­deploying a new 12-megawatt photo­voltaic array as a generating unit. Federal Energy Regulatory Commission rules also have opened the door for more sales to regional electricity grids, especially in the East.

The utility market helps the clean-energy cause, but in this area, too, Manghani said, “there has been this race to the bottom in terms of costs” and many firms are suffering. He said, “Saft is one of the better-performing higher-efficiency-product vendors. The flip side is it tends to come with higher costs. It is not the cheapest battery manufacturer in the market today.”

Other Saft products go to the military, which uses them in such things as for the F-35 Joint Strike Fighter, or for satellite telecommunications or the Airbus A350. Saft also makes modules used for increasingly popular rapid stop-start automobile batteries.

The pace of change in all these lithium-ion battery markets is so fast that the company discloses them in the risk section of its annual report. “The Group cannot guarantee that this technology will be a success, and it cannot be ruled out that different technologies will meet the same needs. Thus, some companies have recently developed batteries using emerging technologies that are likely to be in competition with the lithium-ion technology.”

But at least Saft has survived, and the company still expects production at its Jacksonville facility to ramp up as demand grows. The facility has about 280 permanent workers, and 40 percent of the jobs are held by military veterans. (Unemployment in Jacksonville has tumbled from a high of 11.2 percent in 2010 to 4.5 percent.)

Other major recipients of money under the advanced battery program went bankrupt, including EnerDel, which received $118.5 million. Some reemerged in different forms. The company A123, whose $249.1 million grant was the second biggest, went bankrupt before being acquired by Wanxiang, a Chinese company with wide U.S. holdings. Japan’s NEC bought the part of A123’s technology applicable to stationary storage.

Altogether, the Energy Department gave $2.4 billion to 48 projects under the advanced battery and electric drive portion of the stimulus package. The Energy Department says that three projects were not completed and at least five major recipients have closed their doors, but more than 20 other battery manufacturers, including Saft, are still in business. That includes a General Motors battery-assembly plant.

The Energy Department also says that lessons were learned from some of the unsuccessful projects. With $48 million in funding under the Recovery Act, Chrysler developed and deployed more than 140 advanced plug-in hybrid electric pickup trucks. ­Although some of the vehicles experienced technical issues, the company is applying lessons learned in the development of the 2017 Pacifica plug-in hybrid minivan, an Energy Department spokesman said.

“The president’s critics threw a lot of dust in the air about the energy investments,” Utech said. He added that in the end “the results were transformational.” (White House officials used the word “transformational” at least four times during a call with reporters Thursday.)

Outside analysts agree that the administration had to be judged on the overall package of projects.

“I don’t necessarily see it as a success or failure for the government to have invested in Saft or A123,” said Manghani, noting that even venture capital firms have failures. “You could grade the government not necessarily as an ­A-plus, but I don’t see it as a failure on government’s part just because one of their investments didn’t do as well as it would have liked.”

When it comes to Saft, Utech said Thursday that “clearly we think it’s a success story.” And on Friday, Obama said, “I came here to Saft to show what it means to invest in the future.” Recalling the 2009 grant, he added that “the nation that won the race to drive the economy with new energy was going to be the nation that won the 21st century, and I wanted America to be the one to win that race.”

Meanwhile, Saft’s chief executive in France takes a sober view of his company’s future.

There are very few electric cars today, Lescuyer said. “Why? It’s not because it’s not a good concept. It’s just because it takes time to get adopted, because it takes time to validate.

“How many of you tomorrow will install a residential renewable system in your house?” he continued. “Will you do it tomorrow? Two years from now? Five years from now? And what we see in the industry is the same. It takes time.”