Government regulators on Friday approved the sale of Beacon Power, a bankrupt energy-storage company, to a private-equity firm that will repay most of its Energy Department loans.

Rockland Capital, a private-equity firm focused on energy-related investments, will close a deal Monday to acquire Beacon Power’s 20-megawatt energy facility in upstate New York and its flywheel technology, which stores energy in a series of spinning rotors. Rockland will retain the company’s employees.

The deal restructures a loan obtained through the Energy Department’s controversial loan guarantee program, which also provided more than half a billion dollars to solar-panel maker Solyndra, which went bankrupt last year.

Rockland Capital will assume a $25 million Energy Department loan, replacing the $39 million one given earlier to Beacon Power. Rockland Capital also agreed to put $5.5 million in cash into the company, according to William Baldiga, an attorney with the firm Brown Rudnick, which negotiated the acquisition.

Beacon Power, one of the first recipients of loan guarantees under an Energy Department program to promote renewable-energy technologies, went bankrupt at the end of October.

The deal with Rockland includes an unusual sale of federal grants. Rockland will acquire Beacon’s access to a $25 million Energy Department grant and a $5 million Pennsylvania grant to build a flywheel storage facility there. The grants require an equal amount from private investors, which Rockland has pledged to provide.

Beacon’s technology stores energy and can release it almost instantaneously when there is a sudden drop in power on the electrical grid. The company’s revenues depend on government regulation, and a recent Federal Energy Regulatory Commission ruling will double or triple the amount paid to companies like Beacon Power, Baldiga said. The FERC gave the sale final approval Friday.

Rockland was one of four companies that bid to acquire all of Beacon Power. Six other firms offered to buy parts of it. Brown Rudnick provided legal services on a contingency basis, also unusual in bankruptcy cases.

“The government has decided, for better or worse subject to some criticism, that these are technologies that need to be deveveloped and that private capital needs to be augmented with public support,” Baldiga said. “We’ll see whether this is one of those situations where that will be well rewarded.”