From Dawn Like Thunder (Annotated): The Barbary Wars and the Birth of the U.S. Navy, by Glenn Tucker (Corsair Books, 2019), Kindle Loc. ~980-1000:
England had her first naval brush with the Barbary Powers in 1655. When Oliver Cromwell became Protector, the Dutch ruled the waves and their Admiral Van Tromp moved with his fleet up and down the Channel with a broom fastened atop his mainmast, giving notice that he would sweep England from the seas. After he had been defeated by the English Admirals Blake, Dean, and Monk, and the Dutch Admiral De Ruyter likewise had learned that Blake’s broadsides swept cleaner than a broom, England became the leading sea power.
Admiral Robert Blake, sickly with dropsy [edema], scurvy, and other ailments on his voyages but awesome in battle, was in 1654 given secret orders by Cromwell to sail to Tuscany and collect reparations for injuries inflicted on British shipping. Cromwell would not mind if Blake picked up some of the Spanish treasure ships returning from the New World while he was cruising around Gibraltar. But one of his leading tasks was to chastise the Barbary powers and put an end to their raids on British and Irish seacoast towns.
Blake has generally been held to be the first admiral who dared to take wooden ships against stone fortresses. What he accomplished in this respect must have been in the mind of Captain Edward Preble of the U.S. Navy 150 years later. The question was whether mobility was superior to great stationary strength and he gave the odds to mobility.
Blake claimed forts were effective only for making noises and arousing fears. He sailed into the harbor of Tunis, gave the two fortresses such a pounding that he battered them down, and here and at Algiers and Tripoli he destroyed the pirate fleets and put a stop for a season to all Barbary depredations.
Clearly, Christendom could have used more Admiral Blakes along the Barbary Coast. He managed to pick up part of the Spanish plate fleet as he returned to England. But was that not technically war and in no manner piracy? England and Spain were ever at odds on the sea.
De Ruyter, whose sea greatness was by no means ended by Blake, took a Dutch fleet into the Mediterranean in 1661, dictated treaties with Tunis and Algiers, liberated Christian prisoners, and gave piracy another setback. These nations learned what the United States discerned later, that treaties with petty despots were not worth the paper they were written on.