A new species of dinosaur, first discovered by a farmer in north east China, likely sported beautiful, rainbow-coloured feathers on its head, wings and tail, according to palaeontologists.

Caihong juji – named after the Mandarin word for rainbow – was about the same size as a duck and lived 161 million years ago. Analysis of fossils from the specimen suggest that it was covered in long feathers, some of which appeared iridescent – meaning the colours shimmered and shifted in the light, much like modern hummingbirds.

The new species is described by an international team of scientists in a study published in the journal Nature Communications.

"When you look at the fossil record, you normally only see hard parts like bone, but every once in a while, soft parts like feathers are preserved, and you get a glimpse into the past," said Chad Eliason, a researcher at The Field Museum in Chicago, one of the authors of the study. "The preservation of this dinosaur is incredible, we were really excited when we realised the level of detail we were able to see on the feathers."

In modern birds – the descendants of dinosaurs – colourful plumage is used to attract mates, leading researchers to suggest that the feature served a similar function when Caihong was alive, in addition to keeping the animal warm. However, despite sharing features with modern avians, Caihong would not have been able to fly.

"The tail feathers are asymmetrical, but the wing feathers aren't, a bizarre feature previously unknown among dinosaurs and birds," said Xing Xu from the Chinese Academy of Science, a co-author of the study. "This suggests that controlling [flight] might have first evolved with tail feathers."

Caihong is the earliest known animal with asymmetrical feathers and the earliest evidence to date of a species that may have had bright iridescent feathers.

But its features were unusual in more ways than one, according to the researchers. While its distinctive feathers were a relatively recent evolution, it had several traits typical of much earlier dinosaurs, including a bony crest on its head.

"This combination of traits is rather unusual," said Julia Clarke, from the University of Texas at Austin, a co-author of the study. "It has a velociraptor-type skull on the body of this very avian, fully feathered, fluffy kind of form."