Returning from Palermo to London in 1800 Lady Hamilton, the poet Cornelia Knight, the ambassador Sir William Hamilton, and Lord Nelson stopped on the way for a visit to Eisenstadt.
From 6 to 10 September the entourage was hosted by Nikolaus I, Prince Esterházy with receptions, dances, and concerts in their honor. Haydn organized a performance of his Te Deum and Nelson Mass (Missa in Angustiis), and composed Lines from the Battle of the Nile, to a text by Ms. Knight, for Emma Hamilton to sing.
Hamilton repeated the cantata in Prague on 8 October, and in 1801 the work was published there with the dedication “The music composed and dedicated to Lady Hamilton.”
This according to “Eternal praise! Joseph Haydn komponiert für Lady Hamilton/Eternal Praise! Joseph Haydn compone per Lady Hamilton” by Dieter Richter, an essay included in Lady Hamilton: Eros und Attitüde–Schönheitskult und Antikenrezeption in der Goethezeit/Eros e attitude–Culto della bellezza e antichità classica nell’epoca di Goethe (Petersburg: Michael Imhof Verlag, 2015, pp. 54–56).
Above, Lady Hamilton in a ca. 1782 portrait by George Romney; below, Emma Kirkby sings Lines from the Battle of the Nile.