JPMorgan & Co. (NYSE:JPM) has agreed to pay $410 million to settle allegations that the bank manipulated power markets in California and the Midwest.

The Federal Energy Regulatory Commission, which regulates gas, electricity and oil networks, announced on Tuesday that JPMorgan agreed to pay $285 million in a civil penalty to the U.S. Treasury and give up $125 million of “unjust profits,” with the bulk of the money going to California’s electricity consumers.

FERC claimed that the bank made tens of millions using “manipulative bidding strategies” from old uneconomic gas-fired power plants that they inherited from the purchase of Bear Stearns in 2008.

“We’re pleased that this matter is behind us,” JPMorgan said. “Due to reserves previously set aside, this settlement will have no material impact on earnings.”

The settlement will be of some relief to Blythe Masters, the bank’s head of commodities who was named three times by FERC, finding that she was kept aware of the business dealings and how much money the venture was making.

FERC also claims that Masters repeatedly mislead investigators -- an allegation that the bank denies.