Works of naval fiction such as Patrick O'Brian's Aubrey/Maturin series contain many instances of chivalrous behaviour at war. An interesting real instance is contained in Christopher Hibberts's "Nelson: a personal history". It concerns Nelson's disastrously failed attempt to take the town of Santa Cruz on Teneriefe, the mission that cost him his right arm. The initial landing in boats went wrong when many of them were swept off course, and the element of surprise was lost.
Soon after sunrise, all hope lost, the invaders undertook to abandon their plans for further attacks on the Canary Islands on the understanding that they might return to their ships bearing their weapons. 'Our men drew up in solid files along the Plaza de la Pila with bands playing,' recorded a Spanish officer. 'The English, obeying orders, emptied their muskets by firing them into the sea, and, forming up afterwards ... [marched] over the wall to their boats to cries of 'Viva la Republica! Viva la Libertad!' The mole was littered with dead bodies which were being removed so as not to offend the eye'. The British officers were invited to dinner by the Spanish commander but 'they hardly raised their eyes from the table'. (page 121)
Evidently the opium [for the amputation] did not make Nelson drowsy for long... soon afterwards he was busy dictating letters. To the Spanish commander, who had kindly agreed to the English fleet being provisioned from Teneriefe, he sent his sincere thanks and a cask of English beer, together with a cheese. He also offered to take the Spaniards' dispatches to Cadiz, 'this making himself the herald of his own defeat', and gratefully accepted two casks of Canary wine'.(page 124)