Image caption Small carnivorous dinosaurs like Juravenator starki were nocturnal

Some dinosaurs did their hunting at night, new research suggests.

Studies of the eyes of existing birds and reptiles with different daily activity patterns were compared with similar parts in dinosaur fossils.

The results suggests that small, meat-eating dinosaurs were nocturnal; large, plant-eating dinosaurs tended to forage both during the day and at night.

The Science study also challenges the notion that mammals' nocturnal nature evolved to avoid day-active dinosaurs.

Lars Schmitz and Ryosuke Motani of the University of California Davis have been looking at the eye parts of dinosaurs, and their modern-day descendants the lizards and birds, for a number of years.

They have been trying to determine just how big and how light-sensitive dinosaurs' eyes would have been.

That in turn would be an indication of whether they were active at night; until now the assumption has been that dinosaurs were diurnal, or primarily active in the daytime only.

However, fossils give no indication of how large dinosaurs' pupils would have been - an indication of how much light they could gather up, and thus of whether they were nocturnal "night stalkers".

A prior study in the Journal of Morphology by the pair that showed that the size of the "scleral ring" - a ring of bone that covers the iris and pupil in many animals - is a good indicator of the size of the pupil.

"We measured living lizards and birds to test if you can use these bone parts to distinguish the nocturnals from diurnals," Dr Schmitz explained to BBC News.

"We picked species for which we know their activity patterns - we know if they are nocturnal, diurnal or both - and then we found we could tell them apart [on the basis of their ocular bone sizes].

"Once we had that established we applied what we learned from the living species to the dinosaurs."

The pair measured the eye socket size and scleral ring size of 33 dinosaur fossils, finding that dinosaurs seemed to be busy at a variety of times of day and night.

Image caption The blunt-nosed Scaphognathus crassirostris was found to be a day-active pterosaur

"Contrary to what was believed - that most dinosaurs were diurnal - we saw pretty much everything: we had diurnal, nocturnal and species active both day and night, that was the first surprise," Dr Schmitz said.

"The activity patterns depend essentially on what they do for a living - what the ecology is. Small carnivores like velociraptor tended to be nocturnal or active day and night; we didn't have a diurnal carnivore in our analysis.

"Large herbivores, they were almost exclusively day- and night-active."

Dr Schmitz said this was probably because larger animals needed to forage longer to support their large sizes.

The find also casts doubt on the idea that mammals - who in modern times are predominantly nocturnal - evolved their activity patterns to avoid being targeted by day-active dinosaurs.

"We now know that dinosaurs were active at night as well, so the whole story is much more complicated," Dr Schmitz said.

"We don't even know if early mammals were truly nocturnal; we have do a lot more research to understand how nocturnality in mammals evolved."