(CNN) Rats can be taught to play hide and seek -- and they squeal with joy when they win, scientists have found.

Both wild and domesticated animals have been known to play, but neuroscientists from Berlin's Humboldt University wanted to know more about the topic after hearing from pet owners and vets that rats seemed to be engaging in more complex forms of play.

"It has long been known that rats engage in simple forms of play -- rough and tumble -- but we wanted to know if they could do more complex games, like hide and seek," neurobiologist Michael Brecht, an author of the study, published in the journal Science , told CNN.

Holed up in a laboratory with the rats and a selection of remotely controlled boxes, a team of scientists played a version of the childhood game with the rodents, teaching them how to hide from and find the researchers.

Over a period of a few weeks, they found that the rats quickly learned how to hide and seek -- and even started to develop tactics and strategies for the game.

After being discovered, the rats would 're-hide,' even if it stopped them receiving their reward.

Read More