The streets of a Spanish town near Barcelona were flooded with sea foam during a deadly storm Tuesday and the video is jaw-dropping.

The sea foam caused by Storm Gloria was seen coming through in waves and sticking to buildings in Tossa de Mar, about 90 minutes north of Barcelona. 

According to the National Oceanic and Atmospheric Administration, sea foam forms when the organic and artificial matter is agitated by wind and waves. Algal blooms are a common source of thick sea foam. NOAA says most sea foam is not harmful to humans, but there are exceptions when it comes to large, harmful algal blooms that decay near shore.

RELATED: Watch: Firefighters rescue dog and owner from icy pond

RELATED: How an arctic science expedition could help forecast winter storms

The winter storm left 200,000 people in Spain without electricity, closed down schools and blocked roads as of Tuesday morning. Heavy snow, rain and gale-force winds since Sunday have killed at least four people. 

Emergency services say much of the northeastern province of Gerona was temporarily without electricity Tuesday because of a fault in a power connection with France.

Massive waves and gale-force winds have been smashing seafront towns, damaging many shops and restaurants.

Ports on the island of Menorca were closed. Dozens of roads remained impassable because of the snow, including the highway between the northeastern town of Figueres and the French border. 

Spain's government on Tuesday also declared a national climate emergency, taking a formal first step toward enacting ambitious measures to fight climate change. The declaration approved by the Cabinet says the left-of-center government will send its proposed climate legislation to parliament within 100 days.

The targets coincide with those of the European Union, including a reduction of net carbon emissions to zero by 2050. Spain's Socialist-led coalition government wants up to 95% of the country’s electricity to come from renewable sources by 2040.

In addition to rising global temperatures, scientists say one of the byproducts of climate change is storms that are more intense and damaging.