MINNEAPOLIS (AP) — A divisive fight over the future of a crude-oil pipeline across Minnesota is pinning presidential candidates between environmentalists and trade unions in a 2020 battleground state, testing their campaign promises to ease away from fossil fuels.

Progressive candidates Elizabeth Warren and Bernie Sanders have condemned a Canadian company’s plan to replace its old and deteriorating Line 3 pipeline, which carries Canadian crude across the forests and wetlands of northern Minnesota and into northern Wisconsin. They’ve sided with environmental and tribal groups that have been trying to stop the project for years, arguing that the oil should stay in the ground.

Others candidates — including home-state Sen. Amy Klobuchar and front-runner Joe Biden — have remained largely silent, mindful that such projects are viewed as job creators for some of the working-class voters they may need to win the state next year.

The fight illustrates a hard reality behind the Democratic candidates’ rhetoric on climate change. For months, Democrats vying for the White House have sounded strikingly progressive on the issue, endorsing ambitious targets for reducing carbon emissions and putting forward sweeping proposals for investing in the green jobs of the future. But the debate often glosses over the harder, more immediate choices between union jobs and phasing out fossil fuels. Those fights often divide Democrats and may create an opening for President Donald Trump.

Enbridge Energy’s Line 3 project has generated opposition on two main grounds: that the oil it would carry would aggravate climate change and that it would risk spills in pristine areas of the Mississippi River headwaters where Native Americans harvest wild rice. Enbridge says replacing the 1960s-era pipeline, which is increasingly prone to corrosion and cracking, will be safer for the environment while allowing it restore the line’s original capacity and ensure reliable deliveries to refineries. Labor unions, once the bedrock of Democrats’ support in northern Minnesota, backed the plan on the promise it will create scores of new jobs.

Regulators in Canada, North Dakota and Wisconsin have given the necessary approvals, and some work on those segments already has been completed. In Minnesota, the Calgary, Alberta-based Enbridge is still waiting for permits while court challenges play out.

While it waits, the pipeline has become a political weapon. Democrats and Republicans in Minnesota are in a tug of war over working-class, rural voters needed to win statewide. Trump won enough of those voters to come within just 1.52 percentage points — fewer than 45,000 votes — of beating Democrat Hillary Clinton in 2016. He has said repeatedly he intends to win Minnesota in 2020, something not done by a Republican since Richard Nixon in 1972.

While Trump hasn’t taken a specific stand on Line 3, he’s made it clear that he’s all for oil pipelines. Soon after taking office, he signed executive actions to advance the highly disputed Keystone XL and Dakota Access projects, vowing, “From now on we are going to start making pipelines in the United States.” He backed that up in April with more orders to assert presidential power over cross-border pipelines and to make it harder for states to block them over environmental concerns.

Some Democratic candidates have been eager to draw a contrast. Sanders, a Vermont senator, was the first to come out against Line 3. In January, he tweeted a video of himself listening to indigenous activists about the proposal and wrote: “The dangerous Line 3 pipeline in Minnesota would send a million barrels of tar sands oil — the dirtiest fossil fuel in the world — through the headwaters of the Mississippi River, tribal treaty lands and sacred wild rice beds. It must be stopped.”

Warren, a senator from Massachusetts, weighed in just ahead of a recent visit to Minnesota by tweeting: “The Line 3 pipeline would threaten Minnesota’s public waters, lands, and agricultural areas important to several Tribal Nations. I’m with @MN_350 and Minnesota organizers fighting to #StopLine3 and protect our environment.”

She was referring to MN350, a climate change group that’s part of the opposition. Its spokesman, Brent Benson, called on other candidates who’ve spoken out against climate change to oppose Line 3, too.

“It’s folly to be promoting fossil fuel infrastructure in the middle of a climate crisis,” Benson said. “Presidential candidates have an opportunity and a duty to point that out.”

Other Democrats have not taken clear positions on the project. The campaigns of Biden and South Bend, Indiana, Mayor Pete Buttigieg did not respond to repeated requests for comment. A spokesman for Sen. Kamala Harris of California didn’t address whether she has a position on Line 3, but pointed out that she opposed the Keystone XL and Dakota Access pipelines.

Klobuchar has also avoided taking a position. She has said she wants to ensure a thorough environmental and scientific review to determine if the Line 3 project should move forward. Minnesota regulators signed off on the main environmental review last year, although an appeals court has ordered additional study on the potential impacts to the Lake Superior watershed. But she recently returned $5,600 in donations from an Enbridge project manager after a liberal watchdog group, the Public Accountability Initiative, revealed them.

In contrast to the divided Democrats, Minnesota Republicans have made it clear that they support Line 3, and that they see it as a winning strategy for 2020, coupled with other issues that split Democrats along ideological and geographic lines, such as copper-nickel mining to northeastern Minnesota.

Just before her visit to Minnesota, Warren also tweeted her opposition to a proposed Twin Metals mine near Ely. Like her position against Line 3, it drew an angry response from labor unions.

“Why would you want to be against something that will create so many jobs, and living (wage) jobs, within an area that desperately needs it?” Mike Syversrud, president of the Iron Range Building and Construction Trades Council, told the online news site MinnPost.

When Republican Jason Lewis launched his U.S. Senate campaign at the Minnesota State Fair, the former congressman said he would focus on greater Minnesota — the mostly rural part outside the Minneapolis-St. Paul area — to make up for Democratic strength in the cities. He highlighted the 8th Congressional District, which covers northeastern Minnesota and has swung from blue to red. Lewis said Trump’s campaign is “dead serious about Minnesota,” and that he expects them to follow the same strategy.

“Greater Minnesota is turning red, deep red. ... I don’t know how a Democrat’s going to win the 8th District promising to give pink slips to every trade union member on the Iron Range, promising to stop Enbridge, to stop copper mining, to stop logging, to stop people from having jobs on the Iron Range,” Lewis said.