In 1801 he was present in "Foudroyant" under Admiral Lord Keith during the Egyptian campaign. He then served aboard the frigate , under Captain Robert Campbell; the frigate , Captain Hon. Philip Wodehouse; and , flagship of Lord Nelson. There, on 24 October 1804, he was promoted to lieutenant, and transferred to the frigate , Captain Ross Donnelly. In May 1805 he transferred to the 98-gun ship , Captain Thomas Fremantle, and was present on 21 October in the Battle of Trafalgar.