European and Muslims authorities continued to attempt to control the pirates over many years . The Republic of Bou Regreg did not collapse until 1818 . European and Muslims authorities continued to attempt to control the pirates over many years , but the Republic of Bou Regreg did not collapse until 1818 .