Off the coast of North Carolina, there’s a thin stretch of islands called the Outer Banks. It spans 200 miles. And there’s one part of the Outer Banks that used to be especially treacherous for ships.

Cape Hatteras is known for its choppy seas and strong ocean currents. Since the 16th Century, these waves have caused a lot of shipwrecks — over 1,000 according to the National Park Service. The area has been called the “Graveyard of the Atlantic.”

With so many sailors dying, Congress authorized the construction of a giant lighthouse in the late 1700s. It went up in a small town called Buxton, North Carolina near Cape Hatteras.

Since then, generations of people in Buxton have helped staff and maintain the lighthouse. It’s become an important symbol of the community. Businesses are named after it, like the Lighthouse View Motel and Lighthouse Sports Bar and Grill; churches, too, like The Lighthouse Christian Assembly. It is a source of pride, and a vital part of the local culture and economy.

But back in the 1970s, it looked like Buxton might lose their beloved lighthouse. The sea was getting closer and threatening to swallow it up. And people were torn over what to do about it — they could move the lighthouse, or leave it in place and try to defend it against the forces of nature. For the next 30 years, the people of Buxton fought an intense political battle over this decision. It’s the kind of battle we can expect to see a lot more of as sea levels rise and threaten coastal communities around the world.

The battle started with a scientist, who had an idea that almost nobody liked: “let it fall in,” suggested Orrin Pilkey, at the time a marine geologist at Duke University. In his opinion, “nothing is so important that it can’t fall into the sea.”

In the 1980s, Pilkey used to pack his students into buses and take them to Cape Hatteras. He’d explain that the waves were slowly eroding the shoreline.

For decades, different government agencies had been fighting back against the sea. They’d tried barriers to slow the waves. They’d put down a wall of sandbags. They’d even tried an approach called “beach nourishment,” which means pumping a ton of sand onto the shore. But nothing seemed to work.

After decades of failed attempts to stop the erosion, the ocean was getting dangerously close to the lighthouse. And in 1974, Pilkey wrote an academic article about the problem, basically suggesting that every reasonable solution had been tried, and that it was time to give up.

He wrote, “it is difficult but necessary to come to grips with the ultimate result of living with nature at the shoreline.”

And then he started telling the people of Buxton to let their lighthouse go. This did not go over well with the locals.

In 1981, a photographer and conservationist named Hugh Morton started a group called “Save the Lighthouse.” School children across the state raised money in support. The group recruited prominent North Carolinians, like university presidents, business leaders, and politicians.

Some locals like Danny Couch, who became a representative for Save the Lighthouse, advocated for the idea of building a solid concrete wall around the lighthouse. But Pilkey had maps and diagrams showing how sea walls are actually counter-productive and often lead to accelerated erosion.

Then one day Pilkey met an engineer named Dave Fischetti, who suggested a novel compromise: instead of building a sea wall or letting the lighthouse fall into the ocean, why not move it? Even though the lighthouse was 200 feet tall and weighed 4,800 tons — engineers had moved bigger structures.

And this presented an opportunity, to test something that planners call “managed retreat.” The idea is that, as sea levels rise, we won’t be able to defend every coast with a giant wall. Instead we’re going to have to make plans to abandon certain areas and make choices about what to move out of the way. Pilkey thought that if Buxton could be convinced to move this big lighthouse, it might show that managed retreat is feasible.

So Pilkey and Fischetti, along with one of Pilkey’s students, Dave Bush, formed a group called the “Move the Lighthouse” committee. “We met together a lot and we produced a blizzard of papers,” recalls Pilkey, “documenting things about erosion, things about moving buildings, mainly aimed at the media.”

So now there were two different groups, and both wanted to defend the lighthouse, but in different ways. Ultimately, it would be up to Congress and the National Park Service (because the lighthouse sat on federal land), so each group was trying to convince the government of their plan’s superiority.

The locals were overwhelmingly on one side of the issue. Over 90% of residents polled by a local magazine wanted to keep the lighthouse in place. Hugh Morton said retreating from the shoreline would mean “ceding man’s historic battle against nature.”

People like Danny Couch of “Save the Lighthouse” were sure they would prevail. They were skeptical of outsiders telling them what to do. Some were concerned that the structure might break in transit. Others were worried about compromising its historic value. And, of course, there were local seaside businesses, with views of the lighthouse, that would be directly impacted by a lighthouse move.

Throughout the 1980s and 90s, there were lots of scientific committees, commissions, studies, and reports centered on the lighthouse. They all concluded that moving the lighthouse was the best idea, but that didn’t do much to convince many locals. Bruce and Cheryl Roberts were an exception.

At the time, they were working on a book about the Cape Hatteras lighthouse, and made an interesting discovery: scientists they interviewed told them that the lighthouse sat on yellow pine timbers submerged in a pool of freshwater. The design had worked for over 100 years, but there was a problem: the ocean water creeping in could erode the beams forming the foundation. “And that was the reason,” recalls Bruce, “that Cheryl and I realized that if nothing else happened, the lighthouse would begin to tip as that wood foundation was eaten away.”

Then, in 1996, two major hurricanes hit North Carolina: Hurricane Bertha and Hurricane Fran. Severe weather like this was becoming more frequent and more intense, creating a new sense of urgency. So in 1997, Congress started planning a potential move. A U.S. Senator from North Carolina and a state senator from the region organized a debate in April of 1998. It was attended by close to 800 people and about a dozen news crews. The crowd was quite clearly against moving the lighthouse.

But a few days later, Cheryl and Bruce got a call from state senator Marc Basnight. He had previously supported the moving strategy but was having second thoughts after attending the meeting. So Cheryl spent over an hour on the phone and explained to him about the foundation, eventually winning him over to her side. He, in turn, urged Congress to act fast, and a few months later, they funded the move.

In a last-ditch effort, the local county sued but lost. It was a stinging reminder that even though it may have felt like Buxton’s lighthouse, it wasn’t. It belonged to the federal government.

The move began on June 17th, 1999. Over 200 journalists swarmed Buxton — because nothing like this had ever happened before. No one had picked up a 4,800 ton lighthouse and moved it over half a mile. People called it “the move of the millennium.”

As the lighthouse inched to its new home, it was again set to stand 1,600 feet from shore — the same distance that it was in 1870, before the sea washed the beach away.

Before the move, the people of Buxton felt something terrible and undemocratic was happening to them — out-of-towners were destroying the heart and soul of their island. The community fought hard, and they lost. But things worked out in unexpected ways. “You know, I look back at this,” says Danny, “after this is all said and done. Was moving the lighthouse the right thing to do? Yes it was.”

So he’s had a change of heart, and he’s not alone. In fact, most people think the move was the best thing that ever happened to Buxton. Danny now thinks of it not as a retreat, but a testament to human ingenuity. In turn, this gives hope to people like Orrin Pilkey, who thinks “moving the lighthouse was a profound event” in our “response to sea level rise.”

He sees it as an example of what we’ll have to do in the future to move buildings, or decide which ones to give up, in the face of erosion and sea level rise. “We have 3000 miles of barrier island shoreline,” he notes. “So whatever happens here is also happening in Galveston, Myrtle Beach, and Jekyll Island Georgia. They’re all going to be asking for money from the feds. We need money, we need to nourish the beach. We want to build a seawall. Well it ain’t going to be there. That’s why retreat is so important.”

By 2100, at least 500 US communities will be at risk from sea level rise, including major cities like Miami and New Orleans, according to the Union of Concerned Scientists. And then there’s the millions of people in other parts of the world that will be affected too.

And even after all of this, the Cape Hatteras lighthouse will probably have to move again. It might last 100 years at its current location. But some scientists say it could be even less than that.