Jenny Greenleaf was pleased that it was finally warm enough to go barefoot when she and her husband took their regular walk along York beach in Southern Maine this week.
But when they returned to their beach chairs and began to brush the sand off their feet, they noticed their normally pale soles were a deep black.
“I’ve never seen anything like this,” Ms. Greenleaf, a book designer and artist, said. “It was almost like I walked through charcoal.”
At home they showered and scrubbed their feet, but the smudge, which was neither slick nor greasy, would only partly come off.
Along Maine’s southern coast, as well as in neighboring New Hampshire, many others were also struggling to remove dark stains from their feet.
“I still can’t get it off,” said Kyra O’Donnell, who has had black feet since she visited Great Island Common beach in New Hampshire, about 14 miles south of York beach, on Sunday.
Robin Cogger, the director of Parks & Recreation in the town of York, said she had fielded about 100 calls and emails about stained feet this week. Similar reports on social media came from as far south as Gloucester, Mass., and as far north as Wells, Maine, a span of more than 70 miles.
Theories abounded. Algae and oil were common ones. “In Hawaii, the sand can turn black from volcanic gas, but no volcanoes in Maine so it’s probably something gross,” one man wrote in a local Facebook group.
Ms. Greenleaf had a fringe theory, which even her own husband scoffed at, that involved a submarine she had seen in the area.
“Maybe that submarine belched out a cloud of nastiness,” she said.
On Wednesday, Jim Britt, a spokesman for Maine’s Department of Agriculture, Conservation and Forestry, offered the likely answer: Millions of tiny black kelp flies that feed off decaying seaweed appeared to have died on one stretch of beach.
“It’s not known why,” he said. “Nature does crazy stuff. This might be one of those instances.”
The insect carcasses, which seemed to have washed ashore, contain a naturally occurring pigment, he said.
Efforts were underway to identify the particular kind of kelp fly, which should also help answer where they came from. Regardless, stepping on them does not pose any health issues, Mr. Britt said.
He could not answer whether it would be bad for dogs to eat them, a question that some were asking on social media.
Linda Stathoplos, a retired National Oceanic and Atmospheric Administration oceanographer, did her own informal examination of the sand on Wells Beach in Southern Maine on Tuesday, collecting a sample and looking at it under a microscope.
“There were tons and tons of little bugs, about the size of a tip of a pin,” she said. Some had two wings. Others had four. “They were definitely all dead.”
She could not remember ever hearing about a similar mass “mortality event” of flies.
Neither could Joseph Kelley, a marine geologist at the University of Maine. “I have worked on the geology of beaches for 40 years on the Maine coast and never seen anything like this (or heard about it elsewhere),” he said in an email.
On Facebook, beach vacationers with tainted feet listed all the ways they had tried to get the stain off. Neither dish soap nor baby wipes were particularly successful.
Ms. Greenleaf inadvertently discovered a foot-cleaning solution during a subsequent walk. She and her husband had returned to the beach after a rain to look for clues. Although the search was fruitless, by the end of their walk the sand and stones had buffed the stains away.
“Our feet were spotless,” she said.