A controversial clean energy project with major Massachusetts implications, which Maine voters upended last year in a successful referendum campaign, might not be dead after all.

Maine's Supreme Judicial Court ruled Tuesday that it would be unconstitutional for the 2021 referendum seeking to limit work in the Upper Kennebec Region to retroactively prohibit construction of high-impact transmission lines as part of the New England Clean Energy Connect project, which was already being built after receiving necessary permits.

Doing so, the justices wrote in a 39-page decision, "would infringe on NECEC's constitutionally-protected vested rights if NECEC can demonstrate by a preponderance of the evidence that it engaged in substantial construction of the Project in good-faith reliance on the authority granted by the (certificate of public convenience and necessity) before Maine voters approved the initiated bill by public referendum."

The Maine SJC remanded the case back to a lower court for additional proceedings.

Central Maine Power and its parent company, Avangrid, argued that they had "vested rights" to complete the project because they had spent roughly $450 million to build out the transmission corridor under legally obtained permits.

The 145-mile project would link hydroelectric power generated in Quebec to the regional grid. Massachusetts officials for years viewed it as a way to meet nearly one-fifth of the Bay State's electricity demand with a renewable source.

A 2016 law Gov. Charlie Baker signed directs Massachusetts utilities to procure about 1,200 megawatts of hydroelectric power, part of a statewide effort to move away from coal and nuclear as sources of electricity.