A New Zealand library has finally solved the mystery of why some books were going missing from its shelves.

Auckland Libraries staff were bewildered after finding some books were being hidden in random places.

They initially thought kids playing pranks were to blame, but later discovered it was the city’s rough sleepers who were actually stashing the books so they could return the next day to continue reading.

“A lot of our street community were wanting to put them underneath the couches or underneath book shelves and kind of hiding them in various places,” librarian Sean Taylor told TV NZ.

“Anywhere they thought was theirs and they can keep it there.

“And for a librarian it’s really weird, we’re like ‘oh what’s this book doing here?’ and we’ve put it back.”

Staff found out some of city’s homeless population were hiding the books, explaining without a permanent address they were unable to sign up for a library card that would allow them to take the literature away.

As a solution, Auckland Library created a new section where books can now be left overnight and picked back up again the next morning.