 An influx of Moriscos, who had been expelled from Spain, in the early 17th century helped boost Rabat's growth.Rabat and neighboring Salé united to form the Republic of Bou Regreg in 1627.The republic was run by Barbary pirates who used the two cities as base ports for launching attacks on shipping.