Lava from a volcano on the Spanish island of La Palma reached the Atlantic Ocean late on Tuesday evening, nine days after it started to flow down the mountain.
The molten lava wrecked buildings, destroyed crops and even shut the airport.
Columns of steam that experts had warned could contain toxic gases billowed skywards when the molten rock tumbled into the Atlantic Ocean at 11 pm on Tuesday.
The area had been evacuated for several days as authorities waited for the lava to cover the 6.5 kilometres to the water.
Its erratic flows and changes in the terrain had slowed its progress. Authorities established a security perimeter of 3.5km and asked residents in the wider area to remain indoors with windows shut to avoid breathing in gases.
No deaths or serious injuries have been reported, thanks to prompt evacuations involving more than 6,000 people, in the first hours after last week’s eruption.
Huge clouds of white steam billowed up from the Playa Nueva area as the lava made contact with the ocean.
Dramatic television images showed a stream of glowing lava cascading off a cliff into the water.
"The lava flow has reached the sea at Playa Nueva," the Canary Islands Volcanic Institute (Involcan) said on Twitter on Tuesday night.
Officials said the lava flowing into the sea could trigger explosions and clouds of toxic gas, and the Canary Islands' emergency service urged those outdoors to immediately find a safe place in which to shelter. No injuries were reported.
"When the lava reaches the sea, the lockdown must be strictly observed," Miguel Angel Morcuende, director of the Pevolca response committee, said on Tuesday.
Involcan said that inhaling or contact with acid gases or liquids could cause irritation of the skin, eyes and respiratory tract. It may also result in breathing difficulties, especially in people with existing respiratory diseases,.
Lava has been flowing down the Cumbre Vieja volcano's western flank towards the sea since September 19.
The flow generated an impressive deposit more than 50 metres high, researchers from the Spanish Institute of Oceanography tweeted, posting pictures from the research vessel Ramon Margalef.
It destroyed almost 600 houses and banana plantations in La Palma, which is near Tenerife in the Canary Islands archipelago off the North African coast.
Thousands of people were moved to safety and three coastal villages were locked down on Monday in anticipation of the lava meeting the Atlantic.
Spain classified La Palma as a disaster zone on Tuesday, a move that will bring financial support to the island.
The government announced a first package of €10.5 million ($12.3m), which includes about €5m to buy houses, with the rest to acquire furniture and essential household goods, government spokeswoman Isabel Rodriguez said.
One resident who was moved last week from the village of Tacande de Arriba was delighted to find his house still standing and his pet cats unscathed.
"It's a good feeling, a fantastic feeling," said Gert Waegerle, 75, who on Friday fled the advancing lava with his five turtles but had to leave the cats behind.
"I am super happy because in the end, everything turned out fine."
The two last eruptions on La Palma, in 1949 and 1971, killed a total of three people, two of them from gas inhalation.