The state Senate in the wee hours of the final day of the 2017 legislative session approved a controversial amendment that could shore up the aging Millstone Power Station in Waterford.

The highly complicated proposal directs the Department of Energy and Environmental Protection to conduct an evaluation of nuclear power in Connecticut. The legislation empowers DEEP to enter into an agreement to procure power produced by Millstone.

"I believe this is the right move for the state of Connecticut both in terms of energy policy and economic opportunities,'' Sen. Paul Formica said moments after bringing out the bill at around 2 a.m. Wednesday.

The rise of abundant and relatively cheap natural gas has put plants like Millstone at a severe economic disadvantage; 13 nuclear plants have announced closures, Formica said.

Supporters of the bill point out it provides no subsidies. Rather, it would require DEEP to implement recommendations made by the appraisal by May 1, 2018 if those recommendations are determined to be in the best interest of ratepayers.

DEEP and the Public Utility Regulatory Authority would be charged with determining if it is in the best interest of ratepayers to allow nuclear facilities to sell power directly to utilities to lock in long-term stable prices through a competitive process.

"This is as much of a jobs bill as an energy stability bill,'' said Formica, a Republican from East Lyme who serves as co-chairman of the legislature's energy and technology committee. He noted that Millstone directly employs about 1,500 people but many more work in related industries that serve the plant.

Dominion Energy Inc., Millstone's Virginia-based corporate parent, has suggested it may leave the state if the legislature failed to back a measure broadening its access to electricity markets.

That left a sour taste with several lawmakers. "If we don't do this, there's an implied threat,'' said Sen. Gary Winfield, D-New Haven. Winfield helped to broker the compromise agreement contained in the amendment and said he would reluctantly support it.

"I have had an issue with this issue since it began in the energy committee,'' Winfield said. "I'm trying to figure out what the problem is that we're solving."

Sen. Beth Bye, a Democrat from West Hartford, was one of 9 lawmakers who voted no on the measure. She noted Dominion's earnings topped $4 billion in 2016 and the company has not opened the books on Millstone.

Sen. Ed Gomes, a Democrat from Bridgeport, was also critical. "I don't like this,'' he said. "I don't like being bullied, I don't like this agreement but were being forced into something that we have to do."

Gomes said the bill was needlessly complex. At one point, he read a passage of the amended legislation, pausing to exclaim, "If that don't sound like a load of crap, I don't know what the hell it is."

The amended bill now moves to the House of Representatives for consideration on the final day of the legislative session.