The wooden Rococo bookshelves of the grand Mafra Palace Library hold some 36,000 leather-bound volumes dating from the 14th to the 19th centuries. Book-eating pests would pose a great threat to these old tomes were it not for the inch-long bats who patrol the library at night.

Upon its completion in 1755, the magnificent Palace of Mafra immediately staked its claim as one of the national treasures of Portuguese architecture. And within the palace sits an equally impressive library, which ranks among the finest in Europe.

The 280-foot long Rococo-style library is a fitting home for the thousands of valuable old volumes that line the wooden bookshelves. These books are fragile things, however, and bookworms, moths, and other insects can wreak havoc on their delicate pages.

Most libraries control such pests with ethylene oxide, methyl bromide, or gamma radiation, but the Mafra Palace Library has a very special force of airborne defenders: bats.

During the day, a colony of bats sleeps behind the bookcases or out in the palace garden. At night, after the library has closed, these small bats swoop between the stacks, hunting down the very pests that would otherwise chomp through the pages of the library’s precious collection.

This nocturnal feasting has been going on for centuries, perhaps as far back as the creation of the library itself. The winged protectors, however, do come with one disadvantage: the copious covering of droppings they expend upon the floors, shelves, and furniture each and every night. To combat this, library workers cover the furniture before they leave, and spend their mornings carefully cleaning the marble floors to erase all evidence of the previous night’s excreta.