Chile has returned 3,778 books that its military had taken from Peru's national library - more than 126 years overdue.

Chilean soldiers pillaged the library in 1881 after capturing the Peruvian capital, Lima, during the 1879-1883 War of the Pacific.

The volumes, written in Greek, Latin, French and Spanish, some with full-page colonial-era maps, dated from the 16th to 19th centuries. Chile shipped the books, most in excellent condition, to Peru this week via DHL, where they'll be returned to Lima's national library.

Nivia Palma, national director of libraries, archives and museums in Chile, presented the books to Peruvian officials at a ceremony, calling the act a "concrete expression of our deep commitment to building a relationship of brotherhood and cooperation between our countries."

Foreign Minister Jose Garcia Belaunde thanked Chile for returning the books, and said the two neighbours must work to strengthen their friendship.

Relations between the two nations have been undermined by border disputes dating back to the 19th century war, in which Chile captured territory from Peru and neighboring Bolivia - including Bolivia's only coastline.