Tyree Johnson adored his apartment with a view of the Pacific Ocean — until it began to crumble down a cliff into the water.

He could watch sunsets over the water from his back porch in Pacifica, a few miles southwest of San Francisco, for 15 years.

Dolphin pods swam by, and hang gliders soared overhead. But there was a catch: the bluffs were eroding, and the ocean was gnawing away below.

When he awoke at 4:30 a.m. to a loud noise, it was the ground giving way a few doors down. Authorities told him in April 2010 that he needed to leave before the entire structure collapsed into the ocean.

A UCLA report issued a decade later warned that Johnson’s story would not be unique: Tens of thousands of people who live along California’s coast may be forced to flee in the coming decades as rising sea levels cause swaths of the state’s iconic coast to become uninhabitable.

So far, those dangers have not demolished the dream of living on a California beach. Houses perched on cliff faces are still worth millions of dollars.

The promise of coastal living in California is that there will be no hurricanes, beautiful views, and perfect weather. The majority of the state’s coastline is bounded by cliffs, providing the most desirable locations with expansive, panoramic views of the ocean.

It all comes at a high price: According to the UCLA report, the coast is lined with houses worth billions of dollars. While not every coastal home is owned by a millionaire, property values skyrocket closer to the ocean — regardless of the danger.

The issue of sea level rise is not limited to California. According to a March government study, tens of thousands of homes in other cities, including Miami, Atlantic City, New Jersey, and Galveston, Texas, will be vulnerable in the next 100 years.

Rising seas, however, pose a particularly serious threat in California, where bluff collapses have killed beachgoers and clifftop homes can quickly become unsafe as the ocean batters the coast below. Flooding risks are increasing in low-lying coastal areas as well.

Celebrity homes cling to cliffs, and chain-link fences keep falling rocks at bay in Los Angeles County’s idyllic Malibu, where the Santa Monica Mountains meet the Pacific Ocean.

Anthony Hopkins sold his Malibu mansion in 2020 for about $6.7 million more than he paid for it in 2001. Despite the fact that the house is perched on the edge of a severely eroded bluff — and that the house next door burned down in a fire.

The ocean is encroaching on the laid-back beach town living in San Diego County to the south. On Torrey Pines State Beach, signs warn beachgoers to stay away from the cliffs, where shore access is frequently cut off at high tide as the ocean beats against the cliffs.

It’s always been a risky location — erosion and tides are natural events that constantly alter the coastline’s landscape. Bluffs deteriorate due to a variety of factors other than rising sea levels.

However, as sea level rise projections become more dire, experts now say that living permanently on the ocean’s edge is not sustainable. Authorities have already begun to withdraw: Plans are in the works to relocate Del Mar’s railroad tracks inland, which will cost hundreds of millions of dollars.

It’s difficult to “imagine anything but the inevitable need to slowly move that neighborhood back” in the most vulnerable communities, such as Del Mar and Pacifica, said Charles Lester, director of UC Santa Barbara’s Ocean and Coastal Policy Center in the Marine Science Institute.

Even so, the idea of phasing out at-risk coastal neighborhoods can be politically toxic, especially since many of those homes are worth millions of dollars.

He claims that there are numerous ways to keep the sea at bay for decades. However, the state’s long-term plans have indicated that the government envisions a future in which some at-risk homes no longer exist — causing “hysteria” among homeowners.

When the ocean came for Tyree Johnson’s apartment, he described a sense of resignation. It was a cheap place to live, not a fortress to defend.

He recalls a brief, futile attempt to shore up the cliff, but authorities intervened before anyone was hurt. That’s the nightmare scenario that homeowners, cities and coastal planners are trying to avoid en masse as more homes are threatened by rising seas.