A nocturnal existence is a way of life for numerous mammals, from bats that swoop through dark skies to skunks that emit their noxious spray under moonlight and majestic lions, tigers and leopards that prowl the night.

But this love of nightlife appears to have begun much earlier than previously believed in the lineage that led to mammals — perhaps 300 million years ago — way before the first true mammals skittered under the feet of the dinosaurs about 100 million years later.

Scientists said Wednesday that a study of fossils of small ring-shaped bones embedded in the eyes of an important group of ancient mammal relatives called synapsids indicated that many of them thrived at night or in the twilight.