In Hai Fang Tu Lun the book written by Hu Zongxian, Co-Minister of War in the Ming Dynasty (AD 1368-1644), the military deployment for coastal defense in the Ming Dynasty was recorded. In Guangdong, Hainan, Leizhou Peninsula, Guangxi and other points of strategic significance for coastal defense, watch towers and over-water castles were established. Under the command of the garrison, they were intended for guarding against pirates and patrolling the surrounding waters. "The country was divided into 13 counties and states under several Fu's. In addition, the Nanhai Garrison was also established, controlling 5 Qianhu's (thousand-household bureaus) of internal affairs and 6 Qianhu's of defense. At each of the estuaries and ports, watch towers were established under the control of local garrison, as a preparation against pirates and for patrolling. The patrols were properly distributed and the pirates were discouraged when they see the banners."