Federal prosecutors on Thursday said utility FirstEnergy Corp. had agreed to pay $230 million to resolve charges that it was involved in a bribery scheme to pass a state bailout of nuclear power plants in Ohio.

Under a three-year deferred prosecution agreement, FirstEnergy agreed to pay the penalty and develop a stronger compliance and ethics program, among other things. A wire fraud charge will be dismissed, pending the utility company’s adherence to the terms of the agreement.

“Moving forward, we are intently focused on fostering a strong culture of compliance and ethics, starting at the top, and ensuring we have robust processes in place to prevent the type of misconduct that occurred in the past,” FirstEnergy Chief Executive Steven Strah said in a statement.

Federal prosecutors on Thursday called the agreement a “historic day for corporate accountability.” Vipal Patel, acting U.S. Attorney for the Southern District of Ohio, said the agreement doesn’t preclude his office from prosecuting company employees, and that investigations are ongoing.

Prosecutors last year launched an investigation of FirstEnergy and its involvement in a scheme to channel tens of millions of dollars to a dark money nonprofit that former Ohio House Speaker Larry Householder allegedly used to fund support for a $1.5 billion legislative bailout of two nuclear plants owned by a former subsidiary of the company.

Mr. Householder, who was ousted from his position last year, allegedly used the money to secure the bailout, fund his campaign for speaker and quash an effort to repeal the law that included the subsidy, according to an FBI affidavit. Mr. Householder faces federal racketeering charges and has pleaded not guilty.

According to the deferred prosecution agreement, FirstEnergy and one of its subsidiaries together paid more than $59 million to the dark money nonprofit, which the company knew was operated for the benefit of Mr. Householder.

The nuclear plants that received the subsidy were owned by then-bankrupt FirstEnergy Solutions Corp., now named Energy Harbor Corp. Energy Harbor, which still operates the plants, hasn’t been charged.

Around the time the FirstEnergy investigation began, federal prosecutors also subpoenaed Energy Harbor, asking executives to turn over documents and communications as part of an investigation into whether anyone associated with the company understood that payments made to the nonprofit were part of the alleged pay-to-play arrangement, rather than a legal lobbying effort.

Ohio Attorney General Dave Yost last year filed a lawsuit against the company but said earlier this year that he will wait to press forward until the federal investigations conclude.

FirstEnergy last year fired former CEO Charles E. Jones, as well as two other executives. It said it had determined that they violated “certain FirstEnergy policies and its code of conduct.”

Shares of FirstEnergy rose 4% in trading on Thursday.

Write to Katherine Blunt at Katherine.Blunt@wsj.com