During the summer of 1779 "Monarch" was attached to the Channel fleet under Sir Charles Hardy; in December was one of the squadron with which Rodney sailed for the relief of Gibraltar, and had a prominent share in the action off St. Vincent on 16 January 1780. On returning to Britain Duncan quit "Monarch", and had no further command till after the change of Ministry in March 1782, when Keppel became first lord of the admiralty. He was then appointed to of 90 guns, and commanded her during the year in the Grand Fleet under Howe, at the relief of Gibraltar in October, and the encounter with the allied fleet off Cape Spartel. He afterwards succeeded Sir John Jervis in command of , and after the peace commanded as guardship at Portsmouth for three years. He attained flag rank on 24 September 1787, became vice admiral 1 February 1793, and was promoted to admiral 1 June 1795. In February 1795 he was appointed Commander-in-Chief, North Sea, and hoisted his flag on board .