Even after the republic 's collapse , pirates continued to use the port of Rabat . This led to the attack of the city by Austria in 1829 after an Austrian ship had been lost to a pirate attack . Even after the republic 's collapse , pirates continued to use the port of Rabat , which led to the shelling of the city by Austria in 1829 after an Austrian ship had been lost to a pirate attack .