For the last six years, the Obama administration has been mulling a controversial plan to open up the Atlantic coast for oil and gas exploration. It seemed inevitable that some sort of drilling would eventually occur in this previously untouched region.

Now that's all changed.

In a surprise move Tuesday, the Department of Interior announced it would reverse its earlier proposal to allow oil and gas drilling off the coasts of Virginia, the Carolinas, and Georgia over the next five years. The moratorium will now stay in place through 2022. It's an unexpected victory for environmentalists and coastal residents who had feared oil platforms could dot the Atlantic Ocean for the first time.

"We heard from many corners that now is not the time to offer oil and gas leasing off the Atlantic coast," said Interior Secretary Sally Jewell in a statement. "When you factor in conflicts with national defense, economic activities such as fishing and tourism, and opposition from many local communities, it simply doesn’t make sense to move forward with any lease sales in the coming five years."

Why the Obama administration changed its mind on Atlantic drilling

A couple of broad thoughts on how and why the Obama administration changed its mind on this proposal:

1) President Obama first proposed opening up the southeast Atlantic for drilling back in March 2010. At the time, a major climate change bill was foundering in Congress, and he was looking to attract support from wavering oil-state senators like Louisiana's Mary Landrieu. Environmental groups were livid, but Obama framed it as a necessary short-term compromise — we can't escape oil overnight, so we'll need to keep drilling as we transition to cleaner energy. "This is not a decision I take lightly," he said.

2) That initial proposal was yanked a month later after the massive BP oil spill in the Gulf of Mexico. But for the next five years, Obama remained broadly open to the idea of new offshore drilling. "The bottom line is this," he said in 2010, "given our energy needs, in order to sustain economic growth, produce jobs, and keep our businesses competitive, we’re going to need to harness traditional sources of fuel even as we ramp up production of new sources of renewable, homegrown energy."

3) The Department of Interior floated the Atlantic plan again in January 2015, proposing to sell oil and gas leases in federal waters 50 miles off the mid- and south Atlantic coasts between 2017 and 2022. Supporters included the governors of Virginia, North Carolina, South Carolina, and Georgia — states that stood to gain potentially billions of dollars in royalties from offshore drilling, as well as new jobs.

4) On the flip side, the plan was always controversial with coastal communities in these states. Some residents worried about oil spills. Others that new offshore platforms could interfere with existing tourism and fishing industries. In North Carolina, Coral Davenport reported for the New York Times, "some opponents fear the transformation of the quiet Outer Banks into bustling oil towns."

Through 2015, debate over drilling deepened — even splitting state governments. Virginia's current Democratic governor, Terry McAuliffe, supported new drilling. But his heir apparent, Lieutenant Governor Ralph Northam, came out against the leasing plan. All told, the Department of Interior received more than 1 million comments around its proposal.

5) More recently, the Pentagon lobbied for major changes to the Department of Interior's leasing plan, arguing that any seismic testing used in oil exploration off the coast of Virginia could interfere with naval training exercises.

6) While this battle raged, the broader political pressures in favor of new drilling were fading. Back in 2010, when Obama first pitched the idea, oil prices were on their way up to $100 per barrel, gasoline prices were soaring, and calls to expand domestic supplies was coming from all corners. Today, oil has slumped to $35 per barrel and the world is producing far more crude than anyone really needs (in part due to the shale boom in North Dakota and Texas):

"This has been a pattern for the last 40 years," says Paul Bledsoe, a former Clinton White House aide on climate change. "When oil prices are high, there's a lot of pressure to drill. When oil prices are low, politicians feel much freer to oppose new projects."

7) The administration's thinking around new drilling also seems to have shifted in the past two years. For much of his presidency, Obama seemed to adopt the view that global warming was best tackled by limiting fossil fuel demand — via measures like ratcheting up vehicle fuel efficiency. On this view, there was little use in cracking down on oil supplies, since if we don't drill here we'll just import that crude from elsewhere. Hence Obama's early support for the Keystone XL pipeline or Shell's Arctic drilling forays or this Atlantic offshore proposal.

But environmentalists have pushed back ferociously against Obama's approach in recent years. The climate community has rallied around the idea of a "carbon budget," in which there's only so much carbon we can emit if we want to avoid severe global warming. The corollary to a budget, greens have argued, is that it simply doesn't make sense to open up fresh fossil-fuel reserves for exploitation. We've got to limit both demand and supply.

Obama seems to be inching toward this supply-side approach. Late last year, he nixed the Keystone XL pipeline, saying: "Ultimately, if we're gonna prevent large parts of this Earth from becoming not only inhospitable but uninhabitable in our lifetimes, we're gonna have to keep some fossil fuels in the ground rather than burn them." Then the Department of Interior placed a moratorium on new federal coal leases while it reviewed its policy of selling off public coal for bargain prices.

8) A similar paradigm shift around drilling has been taking place within the Democratic primary, where Bernie Sanders has pushed hard for a "keep it in the ground" approach to fossil fuels. Hillary Clinton, in turn, has gravitated toward Sanders' direction. After staying silent for years, she eventually came out against Keystone XL. Last year, she opposed Obama's decision to allow Shell to drill for oil in the Arctic (Shell ultimately never found anything and gave up). In December, Clinton spoke out against opening up the Atlantic.

So put those all together. Gasoline prices are currently low — below $2 per gallon in much of the country — and there's less of a political price to pay for opposing new oil and gas extraction. Instead, the opponents of drilling had become the dominant voices in the room.

That dynamic could certainly shift yet again if oil prices ever shoot back up. But the Interior Department's decision will be tough for the next president to reverse in his or her first term — since the moratorium will last through 2022. Bledsoe notes that if a new president wanted to come in and open up the Atlantic to drilling, he or she would likely have to push hard to revise the leasing plan from basically the first day in office.

Also note that Obama hasn't gone fully over to the anti-drilling side. The leasing plan announced today could still open new parts of the Beaufort Sea, Chukchi Sea, and Cook Inlet, off the coast of Alaska. That is, if any companies want to try their luck in the forbidding Arctic. (The White House has also put 9.8 million acres of this region off-limits to protect endangered whales, walruses, and seals — a move that angered many Alaskan politicians in favor of expanded production.)

So the fight over drilling continues to ebb and flow, without a clear victory by either side just yet.