A man saved by a webcam, police said Wednesday. Husum police spokeswoman Kristin Stielow said the The man had climbed over pack ice off the coast to photograph a sunset near the town of St. Peter-Ording, then became disoriented on the ice.

The man got attention after using his camera to flash for help by a woman hundreds of miles (kilometers) away in southern Germany who was admiring the sunset on a tourist webcam.

The woman contacted police, who located the man’s signals and guided him into shore by flashing their car lights. Officiers then lectured him on the dangers of trekking on the ice.

If someone did not help him, he could have frozen to death or fallen through the ice, police added.