A powerful winter storm that battered Spain for days caused the streets of a seaside town near Barcelona to be flooded with sea foam.

The storm arrived on Sunday, bringing heavy snow, rain, and gale-force winds to Spain before moving into southern France. On Tuesday, the storm caused high waves that generated sea foam to inundate the coastal town of Tossa de Mar.

Footage obtained by the Associated Press showed waves crashing in over Tossa de Mar's beach, with floodwater moving past shoreline restaurants and businesses on its way to the old town center. Tossa de Mar is located about 90 minutes north of Barcelona.

WINTER STORM IN SPAIN CAUSED SURGE THAT 'RAVAGED' MAJOR DELTA AREA

According to the National Oceanic and Atmospheric Administration, sea foam forms when organic and artificial matter in the ocean is agitated by wind and waves.

Algal blooms are one common source of thick sea foams. When large blooms of algae decay offshore, great amounts of decaying algal matter often wash ashore. Sea foam then forms as that organic matter is churned up by the surf, according to NOAA.

"Most sea foam is not harmful to humans and is often an indication of a productive ocean ecosystem," according to the agency. "But when large harmful algal blooms decay near shore, there are potentials for impacts to human health and the environment."

Authorities in Tossa de Mar described the situation as complicated but told residents the foam did not pose an immediate threat to humans. Local residents were seen assisting in removing the foam but a constant wind kept whipping it up, hampering clean-up efforts.

WINTER STORM LASHES SPAIN FOR THIRD DAY, KILLING AT LEAST 4, CUTTING POWER TO THOUSANDS

Gloria, the powerful winter storm, left more than 200,000 people without electricity as it battered Spain, closing more than 200 roads. Schools canceled classes for more than 5,700 pupils.

View of a collapsed train track and a bridge due a heavy storm in Malgrat, near Barcelona, Spain, Wednesday, Jan. 22, 2020.

View of a collapsed train track and a bridge due a heavy storm in Malgrat, near Barcelona, Spain, Wednesday, Jan. 22, 2020. (AP Photo/Joan Mateu)

Officials in Barcelona said the city’s beaches lost much of their sand due to the high, powerful surf.

Since Sunday the storm has hit mostly eastern areas of Spain with hail, heavy snow and high winds, while huge waves smashed into towns on the Mediterranean coast and nearby islands of Mallorca and Menorca.

Since Sunday the storm has hit mostly eastern areas of Spain with hail, heavy snow and high winds, while huge waves smashed into towns on the Mediterranean coast and nearby islands of Mallorca and Menorca. ((AP Photo/Joan Mateu)

Rubén del Campo, the spokesman for national weather service AEMET, said he expected that once all data was collected the storm will have been one of the strongest on record. Some areas saw their heaviest rainfall in more than 70 years.

CLICK HERE FOR MORE WEATHER COVERAGE FROM FOX NEWS 

On Wednesday, officials announced the death toll had risen to seven.

The river Onyar is seen swollen during a storm in Girona, Spain, on Thursday, Jan. 23, 2020.

The river Onyar is seen swollen during a storm in Girona, Spain, on Thursday, Jan. 23, 2020. (AP Photo/Emilio Morenatti)

Fears also increased that heavy rains could lead to several swollen rivers breaking their banks, among them the Onyar river that flows through the northeastern city of Gerona.

The Associated Press contributed to this report.