He was elected Member of Parliament for Rochester again in 1705. In May 1705 he was given command of the Mediterranean Fleet in partnership with Earl of Peterborough. Peterborough's forces undertook the siege and capture of Barcelona in September 1705. Shovell was given complete control of the Mediterranean Fleet while at Lisbon in November 1706. He commanded the naval element of a combined attack on Toulon, base of the main French fleet, in coordination with the Austrian army under Prince Eugene of Savoy in the summer of 1707. The allies failed to capture the city, but bombardment by Shovell's forces panicked the French into scuttling their own fleet. Shovell was subsequently ordered to bring his fleet home in late October 1707.