In 1798 he was promoted to major-general and the following year was sent on a mission to Corfu to raise an army of Albanian irregulars, although this proved impossible. In 1801 he joined the garrison of the Malta Protectorate, which had been captured the year before and in 1802 became the commander in chief of the British Army in the Mediterranean. During this service he raised the Royal Regiment of Malta; managed the aftermath of a major ammunition explosion and in 1807 helped to put down the Froberg mutiny. In 1805 he was promoted to lieutenant general.