For their new book, The Library: A World History, architectural historian James Campbell and photographer Will Pryce travelled the world to documentary of the architecture of book storage. And they found that libraries, writes Campbell, “can be much more than the dusty, dark wooden shelves.” Indeed, as The Boston Globe‘s Brainiac noticed, in a couple of cases, Campbell and Pryce found that these age-old institutions act as houses for not only books, but bats, too.

At Biblioteca Joanina and the Mafra Palace Library, both, curiously, located in Portugal, and both built in the 18th century, small bats, about an inch long, act as guards against book-eating insects. The Globe reports on the bat-friendly places:

In an email, Campbell explained that the bats, which are less than inch long, roost during the day behind “elaborate rococo bookcases” and come out at night to hunt insects which otherwise would feast on the libraries’ books. The price of this natural insect control is paid in scat: The bats, Campbell writes, “leave a thin layer of droppings over everything. So each morning the floors have to be thoroughly cleaned…and the furniture has to be covered at night.”

It’s not clear how long the bats have been doing this important job, but Portugal, at least, is letting them take care of scaring away the book-eating bugs ( and probably certain human bookworms, too).

More from Smithsonian.com:

To the Bat Cave!

Libraries’ Surprising Special Collections