Three people were killed and at least one other was injured when a coastal bluff collapsed Friday along a popular beach north of San Diego, officials said.

A woman was declared dead at the scene of the afternoon collapse. Two of four people taken to hospitals were initially in critical condition but later died, officials said.

"It has now been confirmed that two of the three victims that were transported to local area hospitals earlier today have succumbed to their injuries," a statement from the city reads.

The collapse near Grandview Beach, where warning signs are posted about the unstable bluffs, was blamed on natural erosion, according to NBC San Diego.

Emergency crews at a coastal cliff collapse in Encinitas, California, on Friday. Mike Blake / Reuters

An eyewitness to the aftermath, Jackie Benedict, told the station that onlookers immediately tried to free the victims before first responders arrived to find a group of beachgoers under debris.

Encinitas city officials said the immediate area of the collapse was closed to beachgoers and warned people to stay clear of bluffs outside the closure zone.

"Given the apparent natural instability, beachgoers should avoid areas near or under the bluffs and keep a recommended safe distance of 25 to 40 feet away," city officials said in a statement.

Download the NBC News app for breaking news and politics

A few miles south of Grandview Beach, railroad tracks on bluffs in Del Mar, California, have been shut down multiple times as the earth has given way. The line is used by Amtrak and the Metrolink commuter rail system to carry more than 4 million riders a year between San Diego and Los Angeles.

"Since the summer of 2018, six bluff failures have been reported in the Del Mar Bluffs area resulting in train traffic delays," the North County Transit District, which runs the tracks, said in June.