France, which had recently emerged as a leading naval power, achieved comparable success soon afterwards, with bombardments of Algiers in 1682, 1683 and 1688 securing a lasting peace, while Tripoli was similarly coerced in 1686. In 1783 and 1784 the Spaniards also bombarded Algiers in an effort to stem the piracy. The second time, Admiral Barceló damaged the city so severely that the Algerian Dey asked Spain to negotiate a peace treaty and from then on Spanish vessels and coasts were safe for several years.