Hundreds of feet below a remote forest near Hudson Bay, Serge Abergel inspected the spinning turbines at the heart of the biggest subterranean power plant in the world, a massive facility that converts the water of the La Grande River into a current of renewable electricity strong enough to power a midsize city.

Mr. Abergel, a senior executive at Hydro Quebec, has for years been working on an ambitious effort to send electricity produced from the river down through the woods of northern Maine and on to Massachusetts, where it would help the state meet its climate goals.

Yet today, work on the $1 billion project is at a standstill.

Over the past few years, an unlikely coalition of residents, conservationists and Native Americans waged a rowdy campaign funded by rival energy companies to quash the effort. The opponents won a major victory in November, when Maine voters passed a measure that halted the project. Following a legal fight, proponents appealed to the state Supreme Court, which will hear arguments on the case on May 10 about whether such a referendum is legal.

At stake is more than one transmission line. The fiercely contested project is emblematic of fights going on around the country, as plans to build clean energy infrastructure run into opposition from residents resistant to new development, preservationists and other companies with their own economic interests at stake.

“At the end of the day, everyone might want more transmission for renewable energy,” said Timothy Fox, vice president at ClearView Energy Partners, an independent research firm. “But no one wants it in their backyard.”

The project in Maine, known as New England Clean Energy Connect, or NECEC, is the kind of large-scale, clean-energy infrastructure that will be required if the United States is to shift away from fossil fuels — a transition scientists say is urgently needed in order to prevent further catastrophic climate change. According to a major study by Princeton University, the country must triple its transmission capacity by 2050 to have a chance at reaching its goal of not adding any more carbon dioxide to the atmosphere by that point.

For years, everything in Maine was going according to plan.

State and federal regulators closely studied the project and gave approvals at every stage. Governors in Massachusetts and Maine were on boar

And Hydro Quebec and Avangrid, its partner on the project that will operate the transmission lines and equipment in the U.S., spent hundreds of millions of dollars readying construction and installing the first 78 of more than 832 new high-voltage transmission poles that would allow energy produced in northern Canada to keep the lights on in Boston.

But there was resistance to the project almost from the start. Maine residents, frustrated by years of poor service by Central Maine Power, a local utility owned by Avangrid, found common cause with environmental organizations skeptical of hydropower.

Those local groups found deep-pocketed supporters in three energy companies that operate natural gas and nuclear plants in the region and which stood to lose money if cheaper hydropower entered the New England grid.

After opponents got a referendum question about the project on last November’s ballot, both sides threw money at the issue, spending more than $100 million — a record for a Maine initiative — on a slugfest that tied the transmission project to hot button issues like gun rights and the Affordable Care Act.

Though Hydro Quebec and Avangrid outspent the opposition by a margin of 3 to 1, residents were not sold on the merits of the project. On Election Day, 59 percent of Maine voters approved a measure that brought work on the NECEC to a screeching halt, at least for the time being.y

If the Maine Supreme Court sides with Hydro Quebec and Avangrid, work on the project could resume and electricity could be flowing from the reservoirs of Canada into the New England grid as soon as 2024.

But if the NECEC is scrapped, it will represent a major setback for those working to wean the United States off fossil fuels, according to independent energy experts. Development of a utility-scale clean energy project requires time and money, and the prospect that it could be killed by voters — even after it is vetted and permitted by government regulators — would inject a level of risk that could scare away investment.

“As hard as it is to explain and defend a project like this, it is so easy for people to come and torpedo it, and they don’t even have to tell the truth,” said Mr. Abergel. “If you can put a stop to these long term projects a year before they’re completed, it raises big questions about the energy transition and how we’re going to get it done.”

Before there was a costly and acrimonious battle in Maine, there was a simple, idealistic mandate: Gov. Charlie Baker of Massachusetts, a Republican, wanted to reduce his state’s dependence on fossil fuels.

On a sunny Monday in August 2016, Mr. Baker appeared before the statehouse in Boston and signed a law intended to ramp up the use of renewable energy in Massachusetts. Hydroelectricity, he said, would “play a crucial role in the Commonwealth’s new balanced and diverse energy portfolio by offering clean, reliable and cost-effective base-load, 24/7/365.”

Mr. Baker’s focus on the always-on nature of hydroelectricity was intentional. While wind farms and solar panels can now produce substantial amounts of power, they cannot generate electricity when the air is still or the sun is not shining. But Massachusetts happens to be relatively close to one of the largest sources of clean, consistent energy in the world: Canadian hydropower.

Engineers have been tapping the Quebec region’s extensive network of rivers to produce renewable electricity for more than a century. Today, Hydro Quebec’s 61 hydropower plants produce 95 percent of all electricity in the province, and prices are lower than anywhere in the United States.

Hydro Quebec has also been exporting power to the United States and other Canadian provinces for decades. Five lines run from the company’s grid into New York, Vermont and Massachusetts, and another major transmission project is in the works to bring hydropower into the New York grid.

“We were blessed with a geology that is rich with water,” said Sophie Brochu, the company’s chief executive, sitting in her office in downtown Montreal. “The electricity is competitive and clean.”

So when Mr. Baker set a goal of drastically reducing Massachusetts’ emissions, Hydro Quebec seemed like an obvious choice.