 He was kept as a prisoner of war until 1797, when he was able to return to the navy and joined the flagship of his old patron, Sir Roger Curtis.After two years in this post, he was given his own ship, which he commanded until the end of the French Revolutionary Wars.Promoted to post-captain in 1802, he was again unemployed for a time, until being given command of various frigates, at first supporting the Spanish in the Peninsular War, but later being sent to the East Indies.