The announcement, which comes after months of Clinton remaining mum over the hot-button 2016 issue, immediately drew praise from liberals and environmental groups but was criticized by Republican presidential candidates.
"I think it is imperative that we look at the Keystone pipeline as what I believe it is -- a distraction from important work we have to do on climate change," Clinton told a community forum in Des Moines, Iowa.
"And unfortunately from my perspective, one that interferes with our ability to move forward with all the other issues," she said. "Therefore I oppose it."
The Democratic 2016 front-runner announced her opposition to the project -- which is still the subject of a years-long State Department review -- as Pope Francis landed in the United States, dominating national media attention.
Clinton had not previously disclosed her position on the campaign trail despite consistent questions about her position on the project, which is widely favored by conservatives but opposed by liberals who believe it will contribute to climate change. In explaining her answer Tuesday, Clinton said she didn't want to interfere with a review process that started under her watch.
"I was in a unique position as secretary of state at the start of this process, and not wanting to interfere with ongoing decision-making that the President and Secretary (of State John) Kerry have to do in order to make whatever final decisions they need," Clinton said. "So I thought this would be decided by now, and therefore I could tell you whether I agree or disagree, but it hasn't been decided, and I feel now I've got a responsibility to you and voters who ask me about this."
Speaking to the Des Moines Register's editorial board
after the event, Clinton said she had "no idea" she would be asked about the pipeline Tuesday.
But, she said, "I think I owed it to people to say where I stood," adding, "clearly, the time had come for me to answer the question."
Jennifer Palmieri, Clinton's communications director, said in a statement to CNN that Clinton's role as a former secretary of state put her "in a different situation than other candidates."
"Having the experience of being a former secretary of state distinguishes her and her candidacy, but it comes with responsibilities that at times can limit her," Palmieri said. "But we know that the experience is well worth whatever price she may pay politically."
A Clinton campaign aide told CNN that the former secretary of state couldn't wait any longer to explain her position.
"She's been taking on water for (not taking a position) ... She didn't want to jam Secretary Kerry or jam the President but it was just time. It's September," the aide said.
The aide said as pressure had mounted for Clinton to take a position, she wanted to give the administration space but doing so became untenable. The aide noted Clinton's meeting with the Des Moines Register, and the campaign was expecting the question to come up. She wanted to be able to answer, the aide said.
The White House was briefed on Clinton's position prior to her comments Tuesday, another Clinton aide said.
"Also, in the course of discussing her plans for increasing investment in energy infrastructure with labor officials in recent weeks, she privately made her opposition to the pipeline known to them as well," the aide added.
Clio Cullison, a student at Drake University who came to the event after a friend of hers at 350.org, an active climate change advocacy group that has regularly followed Clinton on the campaign trail, asked her to attend and ask Clinton about the pipeline.
"I was really nervous to ask," Cullison told CNN. "I haven't asked any political candidates a question ever, so that was really exciting."
The student added that she "was afraid of her answer, to be honest. I didn't know where she was going to stand. I didn't know if she was going to answer at all. I am really glad she did answer, one, and two, did oppose the Keystone pipeline."
A frequent question on the trail
Clinton has repeatedly been asked about Keystone on the campaign trail but has never answered directly.
"I am not going to second guess (President Barack Obama) because I was in a position to set this in motion," Clinton said at a July event in New Hampshire. "I want to wait and see what he and Secretary Kerry decide."
At the same event, she later added, "If it is undecided when I become president, I will answer your question."
And throughout much of 2013 and 2014, Clinton criss-crossed the country on the paid speaking circuit and later on her book tour. She was asked about Keystone a number of times, particularly in Canada, where the pipeline would originate. At no point did she take a position, however.
Clinton's announcement on Tuesday was met with praise from environmental groups.
Jane Kleeb, director of the anti-pipeline group Bold Nebraska, said the decision "was a long time coming," and demonstrates that Democratic candidates need to pay closer attention to the progressive base.
"Political insiders continue to not give credit to the climate movement and not give credit to farmers and ranchers who are opposed to these risky fossil fuel projects," Kleeb told CNN. "This is a big part of her progressive base -- people who are not just against Keystone but want to see action on climate change."
And Bill McKibben, co-founder of 350.org, said Clinton has slowly been moving in this direction since 2010, when she said she was "inclined" to approve the project. "It's been a good evolution, always in the right direction," he said.
"Over time, she has come to understand that a defining issue of the next election is climate change and there's no way to address it seriously without this being answered," McKibben said, calling it a "boondoggle" that he expects Obama to reject as well.
2016ers weigh in
Clinton's Democratic presidential opponents have opposed the deal. On Tuesday, former Maryland Gov. Martin O'Malley, lambasted her for the delay in taking a position.
"On issue after issue -- marriage equality, drivers licenses for undocumented immigrants, children fleeing violence in Central America, the Syrian refugee crisis, and now the Keystone Pipeline, Secretary Clinton has followed -- not forged -- public opinion," O'Malley said in a statement.
Vermont Sen. Bernie Sanders said he was "glad" Clinton came out against the pipeline.
"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."
But Republican presidential hopefuls quickly bashed Clinton over the announcement. Jeb Bush slammed Clinton for favoring "environmental extremists" in making her decision.
".@HillaryClinton finally says what we already knew. She favors environmental extremists over U.S. jobs. #KeystoneXL," he tweeted.
Bobby Jindal noted that Clinton's announcement came at the same time Pope Francis arrived in the U.S.
"Hoping that Americans would be distracted by the Pope's visit, Hillary finally admitted she opposes #KeystoneXL," Jindal tweeted, linking to a petition on his campaign website to urge construction of the pipeline.
South Carolina Sen. Lindsey Graham fired off a series of tweets, saying the pipeline would help the economy and boost national security by reducing dependence on foreign oli.
"In opposing Keystone pipeline, @HillaryClinton once again shows that she intends to continue the failed polices of the Obama Administration," he said.