Sept 1 (Reuters) - The Illinois Senate passed a bill early on Wednesday that aims to prevent two nuclear power plants from shutting this autumn, sending the legislation to the House where it was uncertain if the chamber would bring the legislation to a vote.

The Senate voted 39-16 to pass a wide-ranging energy bill, with two senators voting "present." The bill contains more than $600 million in carbon mitigation credits for nuclear plants which generate virtually emissions-free electricity.

U.S. nuclear plants have been struggling to compete with wind and solar farms and plants that burn low-cost natural gas. Exelon Corp has said it will close its Byron nuclear plant in mid-September and its Dresden plant in November if a state or federal program does not come to the rescue.

It was uncertain whether the House would move fast enough to pass the legislation to prevent the shutting of the first plant, located in Byron, Illinois.

Illinois Governor J.B. Pritzker, a Democrat, said in a statement his "office looks forward to working with members of the House to finalize an energy package that puts consumers and climate first."

The state has been working on the bill for nearly two years but it has been delayed by concerns of Pritzker, some lawmakers and environmentalists that coal plants would not be phased out quickly or allowed to keep running with unproven carbon-capture equipment.

Local media quoted Senator Don Harmon, a Democrat and the Illinois Senate president, saying he thought the House and Pritzker could reach an agreement in a matter of days.

Jaclyn Driscoll, a spokesperson for House Speaker Emanuel "Chris" Welch, a Democrat, said: "The Speaker has been very clear that before an energy proposal is called in the House there must be a consensus among the Democratic caucus and stakeholders, as well as include strong, meaningful ethics provisions."

Driscoll did not respond to a question on whether the bill could be worked out in days. The House left town after the Senate passed the bill, but is expected to return in less than two weeks to approve changes to an ethics bill.

Gina McCarthy, President Joe Biden's climate adviser, has said some existing nuclear plants are "absolutely essential" to hit U.S. goals to decarbonize the electric grid by 2035.

Incentives are included in the infrastructure bills being considered by the U.S. Congress. But Exelon has said these alone would come too late to save Byron and Dresden. The plants have more than 1,500 workers, many in high-paying union jobs.

The United States has 93 nuclear reactors, more than any other country, but that is down from 104 in 2012. (Reporting by Timothy Gardner in Washington Editing by Matthew Lewis)