The woman seated before the row of suited state legislators in her red Husker team hoodie was choking on tears. She had grown up on a farm in Nebraska. Her parents had grown up on farms, in the days before electricity and running water, and now she said generations of toil and sweat could be destroyed in an instant by a $7bn pipeline project.

A leak from the pipeline, which would run from the tar sands of Alberta to the refineries of Texas, could poison her land forever, Donna Roller told the hearing this week during a special session of the state legislature. "This thing shouldn't even be built. It's wrong and it's toxic," she said. Then she went outside and collapsed against a wall, sobbing. "Somebody, something has got to stop it," she said. On Thursday, something did. The State Department said it would review alternative routes for the pipeline to avoid ecologically sensitive areas of Nebraska. The announcement was an unexpected victory for environmental groups and for landowners like Roller who had despaired of forcing Barack Obama to take a tough stand against the oil industry going into an election year. Environmental groups in Washington had cast Obama's decision on the Keystone XL pipeline as a personal test of his green credentials, warning he could lose their support in the elections if the project went ahead. But the Obama administration said explicitly on Thursday that it would not have put a hold on the pipeline without people like Roller putting a vast expanse of open prairie called the Sand Hills on the national map.

"This message about the Nebraska Sand Hills has been coming strong and with increasing intensity," Kerri-Ann Jones, a State Department official, told a conference call with reporters on Thursday afternoon. "If you look at what is happening in Nebraska I think you can see this is gathering much more attention, much more concern."

At the special session of the Nebraska state legislature this week, dozens of landowners, like Roller, got up to testify about their deep attachment to an ecologically sensitive area of grasses and shifting sand dunes. "It's where all our cowboys and ranchers come from," said Jane Kleeb, the force behind Bold Nebraska which opposes the pipeline. The region is viewed as a natural treasure by Nebraskans. It also sits atop an important underground source of water that touches eight states. In the spring time, the water comes up so high the grasses are soggy – making the area even more vulnerable to an oil leak. So when the Obama administration signed off on a route that would take the pipeline straight through the Sand Hills, there was immediate trepidation from some landowners along the route. Outside the Sand Hills, however, the issue did not immediately resonate, not even with Roller, who left the family farm when she went to college and now works part-time at a Target. She said she is mortified now to think of it, but she hadn't really been paying attention to the talk about a pipeline. "Is this a horrible comment to say? I didn't think it was coming on my land, or near my land. I didn't know it was threatening our water and our land. I had no idea. I just totally wasn't paying attention." She saw a map of the proposed route for the first time last month. "I said holy god, oh my god, it's in the Sand Hills. It's in my backyard," she said. "My first thought was how can they come in and dig up the best land in Nebraska?" At that point, however, the pipeline seemed unstoppable. The State Department had signed off on an environmental review that found no major risks to pumping up to 833,000 barrels a day of highly corrosive Alberta crude through a 36-inch pipeline across six American states. Elected officials in Nebraska had said they had no legal authority to block the project. The state legislature failed to act on three proposals to route the pipeline away from the Sand Hills. The Canadian government and TransCanada, the pipeline company, had mounted an intense PR effort to sell the pipeline as an employment creation scheme and as a source of "ethical oil", outside the Middle East. But then a new coalition of activists, led by the writer Bill McKibben and operating outside establishment Washington power circles, organised a two-week sit-in at the White House that saw more than 1,200 people willing to go to jail to stop the pipeline. In Nebraska, Kleeb was also getting going. Kleeb, a transplant from Florida, claims she is so hyperactive an organiser she used to hand out membership cards for games of hide-and-seek as a child. She had been working on health care when a friend suggested she go to a public meeting about the pipeline in the small town of York. It was April 2010. "Every landowner that got up was opposed to the pipeline and the room had 150 people in it and no one was organising around this issue yet," she said. That told her she had a cause. But, she added: "We didn't know how big it was going to get or if it was going to get any traction at all." She went on: "We just weren't sure if Nebraskans were going to want to get involved in the first place and to be able to sustain a long fight. Actually, I wasn't even sure it was going to be a long fight. At first I thought there is no way in hell we are going to be able to beat back an international oil company." Kleeb got some funding from the National Wildlife Federation, and set up a website, called Bold Nebraska. She also began organising local ranchers. Not long after the meeting, the BP spill occurred, and with it nearly three months of video from the ocean floor showing oil gushing into the Gulf of Mexico. A pipeline burst in the Kalamazoo river in Michigan, and then in the Yellowstone river in Montana. In TransCanada's view, those accidents were pivotal. "It changed how many people looked at the energy industry as a whole," said Shawn Howard, a company spokesman. "Right after those incidents happened that is when we saw the professional activists' campaigns against the pipeline begin and they just ramped them up more and more," he said. But several landowners at the public hearings in Nebraska this week said it was TransCanada that turned them against the project. They accused the pipeline company of bullying them to sign over rights of way for their pipelines. John Hansen, the president of the Nebraska Farmers' Union, said he had never seen such anger in his 22 years with the organisation. "They were pretty much fighting mad," he said. He said more than 100 of his members had complained of attempted intimidation by TransCanada. "They use intimidation all the time. They get somebody who is emotionally susceptible and they just pound on them until they break. They get somebody who had a death in family, they get someone who is a widow, they get someone who is vulnerable and they just amp up the pressure until they fold," Hansen said. All of those factors began driving protests, in Nebraska and nationally. The organisers did not always agree. The big environmental groups, like the National Wildlife Federation and Natural Resources Defence Council, wanted to focus on climate change; tar sands crude has a heavier carbon imprint than conventional oil. That would not work for Nebraska, however. "I get that argument and I understand the serious consequences of climate change. It's just that folks here are concerned about our heritage, our land, and our water," said Kleb. But the combination of pressures – from Nebraska and nationally – eventually began wearing on Obama. Last August, more than 1,200 people were arrested at the White House in a two-week sit-in against the pipeline. The activists returned on Sunday, forming a human chain around the White House. The authorities in Lincoln and Washington began edging towards a decision that would satisfy the protesters – without alienating the oil industry or voters concerned about energy security. In Washington, the State Department agreed on Monday to an independent investigation of charges by environmental groups and members of Congress that it had mishandled its review of the project.

Bernie Sanders, an independent Senator from Vermont, and other Congressmen had accused the State Department of bias, noting it had hired a contractor that worked for TransCanada to assess the environmental risks of the project. In Lincoln, meanwhile, the Republican governor, David Heineman, directed the part-time legislature to go into special session and look for potential remedies to people's concerns about the pipeline. The state senators spent up to 12 hours a day this week, hearing what Nebraskans had to say about the pipeline. They heard from people like Roller claiming emotional connections to land that had been in their family for decades. Some were sixth-generation Nebraskans. They heard from ranchers who had discovered an entirely new way of doing business in old cowboy territory, raising grass-fed organic beef for Whole Foods and other specialty outlets. "I can't even put creosote fence posts in my ground because of the organic certification and hear I am contending with a toxic pipeline within a half mile of my property line. I don't know what I am supposed to do," said Bruce Boettcher, who is the fourth generation of his family to raise cattle in the Sand Hills region. By the end of the public hearings, however, it wasn't clear the pipeline opponents were making much headway with the state senators. In a walk along a dimly lit hall to yet another public session, Chris Langemeier, the chairman of the natural resources committee, complained there was a sameness to the complaints about the pipeline. "If I get 100 emails in my inbox, 22 are from the same person," he said. Other members of the committee seemed unmoved by the drama. One used his time to complain that the Obama administration needed to open up more areas for offshore drilling. "We wouldn't need this pipeline if we had a federal government with its head screwed on, but we don't so we are doing the next best thing we can do," Mark Christensen said. By late Wednesday, after considering five different proposals to re-route the pipeline, or block TransCanada's legal authority to land along the proposed route, the senators came to a decision. They rallied around a bill, put forward by Langemeier, that would force the decision over the pipeline route right back at the governor. "There may not be a legislative cure for this," said Langemeier. But with the State Department's announcement on Thursday, there may be a cure in waiting.

• This article was amended on 14 November 2011. The original picture caption referred to "tar sandhills" in Nebraska. This has been corrected.