This story has been updated.

DES MOINES, Iowa – Democratic presidential front-runner Hillary Rodham Clinton declared opposition to the proposed Keystone XL pipeline on Tuesday, ending a long and politically uncomfortable silence on an issue that has become a touchstone for environmentalists and liberal voters.

“I think it is imperative that we look at the Keystone pipeline as what I believe it is – a distraction from the important work we have to do to combat climate change,” Clinton said at a community forum here.
The debate over Keystone “interferes with our ability to move forward,” Clinton said. “Therefore I oppose it.”

Clinton had long insisted she must remain on the sidelines of an Obama administration decision about the proposed Canada-to-United States oil pipeline because she had been involved in negotiations over the pipeline when she was secretary of state. For her to weigh in now, as a political candidate, would put the White House and the State Department in a difficult position, Clinton had said.

But while she stayed mum, progressive challenger Sen. Bernie Sanders (I-Vt.) won significant liberal support for a straightforward denunciation of the project. Democratic challenger Martin O’Malley, a former Maryland governor, and Clinton's own senior campaign adviser, John Podesta, also oppose the pipeline.

Pope Francis, who arrived in the United States Tuesday, has also sought to make climate change a moral issue.

Clinton said Tuesday that the administration review is taking too long, and she must make her position clear. She was responding to voter questions following a healthcare event at an elementary school. It had become untenable to refrain from speaking any longer, Clinton told a young woman who asked her about Keystone.

Sanders’ issued a statement almost immediately.

“As a senator who has vigorously opposed the Keystone pipeline from the beginning, I am glad that Secretary Clinton finally has made a decision and I welcome her opposition to the pipeline,” Sanders said. “Clearly it would be absurd to encourage the extraction and transportation of some of the dirtiest fossil fuel on the planet.”

Sanders is leading Clinton in many polls in New Hampshire and running even with or only slightly behind her in Iowa, largely on the strength of liberal positions that have struck an anti-establishment chord among Democrats.

Clinton has always struggled to rouse sustained enthusiasm from the far left of her party. Keystone became a symbol for some liberal leaders of Clinton’s perceived distance from their priorities.

In an interview with the Des Moines Register later Tuesday, Clinton expanded on her position.

"I don’t think we need to have a pipeline bringing very dirty oil," over the border, Clinton said.

She said she will soon release a plan to knit together energy production and distribution across North America.

As to why she is speaking now, Clinton told the newspaper that "it's been a long time" since she left the State Department in early 2013, and she had thought the administration decision would be made by now.

She had signaled recently that she felt an imperative to speak out soon, and her campaign said the White House was informed ahead of time about her position. Clinton said she had no plan to speak out Tuesday, but got a direct question and so went ahead.

The news had the effect of overshadowing her announcement here of a new proposed $250 monthly cap on patients' out-of-pocket prescription drug costs.

Democratic environmental activist Tom Steyer, a major party donor, called Clinton's position "a clear example of people power overcoming the special interests."

Clinton made her position known seven years after the Canadian company, TransCanada, proposed the 800,000 barrrel-a-day pipeline to carry thick bitumen from Alberta's oil sands, or tar sands, to refineries on the Gulf Coast in Texas. The project has become a touchstone for the environmental movement, which has argued that blocking construction would slow down development of the oil sands, whose extraction is more energy intensive than most types of crude oil and therefore emits more greenhouse gases.

"Our focus remains on securing a permit to build Keystone XL," said TransCanada spokesman Davis Sheremata.

"The fundamental argument for Keystone XL has been and remains - the U.S. imports millions of barrels of oil every day, so where do Americans want their oil to come from?" Sheremata said. "Do they want it from Iran and Venezuela – where American values of freedom and democracy are not shared - or do they want Canadian and American crude oil transported through Keystone XL."

The State Department is the agency responsible for issuing a cross-border permit for pipelines, and the project application was pending throughout Clinton's tenure as secretary of State. In mid-October 2010, Clinton told an audience at San Francisco’s Commonwealth Club that she and others in the administration were “inclined” to give TransCanada the permit, adding, “We’re either going to be dependent on dirty oil from the Gulf or dirty oil from Canada.”

Paul Bledsoe, a former Clinton White House aide on climate change, said Clinton "is in a tough primary battle, and opposing Keystone has direct appeal to many Democratic activists she is courting, so this is no surprise. It's hard to see her taking any other position politically at the moment, despite Keystone's relative un-importance as a substantive climate and emissions issue."

"Clinton's opposition will make it that much more difficult for President Obama to disappoint party activists and approve the pipeline," Bledsoe said.

"It's about time," said Erich Pica, president of Friends of the Earth Action, the political arm of the environmental group. "Now we need President Obama to finally deny the Keystone XL pipeline permit. And we need Secretary Clinton to use her Keystone XL test to keep fossil fuels in the ground."

The White House is now seen by the oil industry as the main obstacle but White House spokesman Josh Earnest deflected a question at Tuesday's briefing when asked how the administration might respond to an announcement by Clinton, who had said last week that she would finally have to take a position.

"This is a policy process that continues to be under way over at the State Department, and for updates in terms of the time frame in which a decision will be reached, I would refer you to the State Department," Earnest said. But sources at various agencies involved in reviewing the pipeline permit proposal have said in recent months that little work was being done to advance the project.

Although Clinton's position might give her a boost in the Democratic primaries, its effect on her longer term election prospects are less clear. The oil industry has successfully portrayed the project as an important creator of jobs, though most of those jobs would last a year or two while the permanent number would be fewer than 40.

Clinton's move runs against public opinion, where polls show consistently high support for the pipeline. A January CBS News poll found 60 percent in favor of building the pipeline while 28 percent were opposed. A separate survey last year by the Pew Research Center found majority support among most Republican and Democratic-leaning groups. The exception were solid liberals, who opposed the pipeline by nearly 2 to 1 margin.

Americans see a positive trade-off in the pipeline - they are optimistic about the pipeline's potential to create jobs and less certain of environmental downsides. A Washington Post-ABC News poll last year found 85 percent think the pipeline would create a significant number of jobs, while 47 percent thought it would pose a significant risk to the environment.

Many things have changed since TransCanada proposed its pipeline. The project was conceived as oil prices soared in 2007 and 2008, proposed to State in late 2008 as the financial markets were collapsing, and languished in subsequent years as oil prices soared again to more than $100 a barrel. But in the past year oil prices have plunged, prompting some oil sands companies to delay projects.

The pipeline is seen by the industry as crucial to cutting costs, because the pipeline fee is cheaper than fees charged by railroads, which have taken advantage of the lack of pipeline capacity in the region.

The Keystone XL pipeline was originally designed to run from just east of Edmonton to an existing pipeline in southern Nebraska, then pick up again in the giant oil terminal in Cushing, Okla. and run to Port Arthur, Texas. The southern leg of the project received approval from the Obama administration and has been constructed. But the northern leg remains in limbo. Meanwhile, many other pipelines have expanded their carrying capacity, but TransCanada is still committed to its project.

Mufson reported from Washington. Polling analyst Scott Clement contributed to this article.