The Muslim had their mosques in the foreign quarter on the south bank of the Canton River.[4] Not all of the immigrants were Muslims, but many or some of them stayed. It is recorded that in 758, a large Muslim settlement in Guangzhou erupted in unrest and fled. The same year, Arab and Persian pirates who probably had their base in a port on the island of Hainan.[4] This caused some of the trade to divert to Northern Vietnam and the Chaozhou area, near the Fujian border.[4] The Muslim community in Canton had constructed a large mosque (Huaisheng Mosque), destroyed by fire in 1314, and reconstructed in 1349–51; only ruins of a tower remain from the first building.