At the withdrawal from the Mediterranean in late 1796, "Princess Royal" was paid off and Purvis given command of the 98-gun ship of the line with the Channel Fleet, serving at the blockade of Brest. In 1801 he moved to the 100-gun and briefly returned to shore at the Peace of Amiens. In 1803 he returned to service once more in the Napoleonic Wars, and spent a year in command of until promoted to Rear-Admiral in 1804. In 1806 in this position he was sent to serve with the Mediterranean Fleet once more, commanding the blockade of the Spanish port of Cadiz. Following the outbreak of the Peninsular War in 1808, Purvis led his squadron into Cadiz harbour to secure the Spanish fleet from capture by the advancing French and at one point deliberately destroyed the seaward defences of the port when it seemed likely that the French would overwhelm the landward defences. Ultimately however the French were unable to take the city. Purvis was present at Cadiz in 1810, when a storm blew several Spanish and Portuguese ships ashore where they were destroyed by French artillery fire. Purvis later retired ashore and became a Commissioner of the Navy Board. He married twice, first in 1790 with one son; his wife died in 1798. Secondly he married Elizabeth Dickson, daughter of Sir Archibald Dickson, who survived him. He was promoted to Admiral of the Blue, and died at home at Lymington, Hampshire in the summer of 1825.