For a 600-year period from the early Ming dynasty to the late Qing dynasty, Dapeng Fortress was continuously invaded by pirates. During the Ming-Qing transition, anti-Qing forces who wanted to restore the Ming empire led by Li Wanrong captured the city and occupied it for 10 years. History books wrote that Dapeng was the greatest of the coastal cities, which shows the relative importance of its strategic location. The imperial court sent more and more soldiers to the fortified city. The local soldiers were highly skilled, with many being promoted to generals. The most outstanding soldiers were the five generals of the Lai clan and Liu Qilong. Liu Qilong, a provincial governor of the navy from Fujian province, had a eulogy written for him by the Daoguang Emperor of the Qing dynasty.