The 3.8-magnitude earthquake was centered about 10 kilometers southeast of York Harbor in Maine, officials said.