Hillary Clinton has broken her longstanding silence over the construction of the proposed Keystone XL pipeline, saying at a campaign stop in Iowa that she opposes the controversial project.

The Democratic presidential candidate said she decided to speak out after concluding the ongoing debate over whether the pipeline should be built had become a distraction to larger efforts to fight climate change.

That distraction, she said, is "unfortunately, from my perspective, one that interferes with our ability to move forward to deal with the other issues. Therefore I oppose it."

Time to invest in a clean energy future—not build a pipeline to carry our continent's dirtiest fuel across the US. I oppose Keystone XL. -H —@HillaryClinton

Clinton's announcement came as she has ceded ground in some polls to Vermont Senator Bernie Sanders, who has long opposed the project. It also followed the appearance of protesters at some of her recent campaign events holding signs that read, "I'm Ready for Hillary to say no KXL."

The former secretary of state had previously said she shouldn't take a position on the issue, because she didn't want to interfere with the Obama administration as it considers whether to allow construction of a pipeline that would transport oil from Canada's oilsands to refineries on the Gulf of Mexico.

But spurred on by environmental activists and liberals who play a key role in the Democratic primaries and vigorously oppose the pipeline project, Clinton had expressed impatience in recent weeks over the Obama administration's drawn-out deliberations.

Her campaign said the White House was briefed on Clinton's position prior to her comments and she privately made her opposition to the pipeline known when she discussed her plans with labour officials in recent weeks.

Alberta Premier Rachel Notley applauded Clinton's stance. Notley has long opposed the project, saying upgrading and refining should be done closer to home.

"I do think we need to get our product to tidewater," she said. "I'm just not convinced that getting our product down to the gulf where there's a whole bunch of cheap refining is absolutely the best strategy for an industry in Alberta when Albertans want to see focus more on upgrading and refining."

Clinton is scheduled to raise money in California over three days beginning Sunday and was sure to face questions from donors on why she had yet to stake out a position.

Tom Steyer, a leading environmentalist and top Democratic donor, said it was a "clear example of people power overcoming the special interests" and credited Clinton for joining with "thousands of Americans calling on President Obama to reject the Keystone XL pipeline in favour of building an American economy powered by clean energy."

The chairman of the Republican National Committee said Clinton was being "blatantly dishonest" when she said her role at the State Department had prevented her from taking a position. Reince Priebus said concern about U.S. Vice-President Joe Biden's political future played a factor in Clinton's decision.

Canada reacts

The announcement was viewed with disappointment in Canada, where Prime Minister Stephen Harper has said as recently as last month that he was confident the next U.S. president would approve the project.

"This is not a debate between Canada and the U.S.," said Stephen Lecce, a spokesman for Harper. "We know the American people support the project. We will not engage in presidential primary debates."

But a Canadian environmental advocacy group applauded Clinton's stance on the pipeline, saying it reflects concerns the organization keeps hearing.

"This decision shows that political leaders in the U.S. and around the world are realizing that we cannot continue to build fossil fuel infrastructure that will be around for generations," Environmental Defence executive director Tim Gray said in a statement. "It is also a clear sign that the public is looking for clean energy solutions rather than more high-risk fossil fuel development."

Clinton also announced Tuesday that she would pursue a clean energy strategy with Canada and Mexico.

A political move

The move signals Clinton must feel as though she's losing the nomination race, an economist with the University of Calgary's School of Public Policy said.

It's clearly a political decision, Michal Moore told CBC News.

"When the State Department was under her control, they were signalling different outcomes," he said. "To say this is all about the climate-related impacts of the pipeline itself — and that by not building the pipeline, you're going to control emissions is, at best, silly."

It's unclear what this could mean for TransCanada Corp., the Canadian company that proposed the pipeline.

"What this probably means ... is that they will probably continue with the two segments of the pipeline as they are right now," Moore said. "They might arrange for a rail transfer across the border."

A spokesman for TransCanada said Tuesday the corporation will continue working to secure a permit to build Keystone XL.