In the early Ming Dynasty, Japan, which is separated from China by only a narrow strip of water, entered the period of feudal division known as the Southern and Northern Dynasties, where feudal lords fought for power and profit. Some defeated feudal lords, abandoning their previous friendly relations with China, organized samurai, merchants, and ronin to raid and pillage along China's coastal regions, and these people were called "Japanese pirates" (wokou). The scourge of the Japanese pirates first emerged during the reign of Emperor Shun of the Yuan Dynasty. In the second year of the Zhizheng era (1336), Ashikaga Takauji, who had previously assisted Emperor Go-Daigo of Japan in suppressing a rebellion, deposed Emperor Go-Daigo, installed a new emperor, appointed himself as the Seii Taishogun (Great General for Subduing the Barbarians), and established a shogunate in Kyoto. Emperor Go-Daigo fled south and established the "Southern Court" in Yoshino, opposing the "Northern Court" in Kyoto. From then on, Japan entered a period of conflict between the two courts. In addition to fighting each other, they frequently supported and colluded with pirates to harass China's coastal areas, plundering goods, thus forming the pirate menace of the late Yuan and early Ming dynasties.
During Zhu Yuanzhang's reign, in an effort to eliminate the wokou (Japanese pirate) threat, he repeatedly sent envoys to Japan, but unfortunately without any results. In the 25th year of the Hongwu era (1392), the Northern Court unified Japan. The defeated Southern Court lords, having lost their base, entrenched themselves on islands and frequently raided China's coastal areas, even digging up graves, causing great suffering for residents along the long coastline from Liaodong and Shandong to Guangdong. The Ming Dynasty built over a dozen defensive fortifications to resist the wokou, achieving some success. At the same time, Ashikaga Yoshimitsu, the third shogun of the Ashikaga shogunate that had unified Japan, also sought to eliminate the remnants of the Southern Court and, eager to profit from trade with the Ming Dynasty, actively suppressed the wokou, leading to the restoration of diplomatic relations between China and Japan. During the Chenghua era (1465–1487), as the Ashikaga shogunate weakened, some shugo daimyo (military governors) who lacked the right to trade with the Ming began engaging in piracy, disrupting normal Sino-Japanese trade. By the Jiajing period, official trade between China and Japan had completely ceased, and the wokou once again ran rampant along China's coast. They colluded with Chinese pirates and corrupt officials who defied the court's maritime ban, wreaking havoc in the coastal regions of Fujian and Zhejiang.
In the 27th year of the Jiajing reign (1548), Zhu Wan was appointed by the Ming Dynasty to blockade the Fujian coast, where he killed nearly a hundred people who were collaborating with Japanese pirates, thereby infringing on the interests of local officials and wealthy merchants. These officials and merchants instigated some court officials to impeach Zhu Wan for unauthorized killings, forcing him to commit suicide. From then on, the Japanese pirates became even more rampant, committing heinous crimes in China and bringing severe disasters to the Chinese people.
The long-term scourge of Japanese pirates aroused Chinese indignation, producing many patriotic generals in the anti-pirate struggle, with Qi Jiguang as the representative.
Qi Jiguang (1528-1588), courtesy name Yuanjing, was born in Dengzhou, Shandong (present-day Penglai, Shandong). In the thirty-fourth year of the Jiajing era (1555), he was transferred to Zhejiang as a regional commander, tasked with defending the three prefectures of Ningbo, Shaoxing, and Taizhou against Japanese pirate raids along the Jiangsu and Zhejiang coasts. Upon taking office, Qi discovered that the local troops were plagued by deep-seated bad habits and completely lacked combat capability, yet the people fought bravely. He therefore posted recruitment notices and enlisted a new army of three to four thousand soldiers, primarily composed of farmers and miners from Yiwu. He also upgraded military equipment such as warships and firearms, subjected the new troops to rigorous training, and taught them to practice the "Mandarin Duck Formation" in order to kill the bandits and protect the people.
The Mandarin Duck Formation was created by Qi Jiguang after studying the terrain, the weapons and equipment of the Japanese pirates, and their combat tactics. At the time, Qi Jiguang noticed that the Jiangnan region had many swamps and winding roads, making it difficult to deploy troops, and that the Japanese pirates were skilled at ambushes and used short weapons like the Japanese sword, so he created the famous Mandarin Duck Formation. A single formation consisted of eleven soldiers, including one squad leader, with the other ten soldiers arranged in two columns of five on either side of the leader. The squad leader directed the battle. The ten soldiers in the columns carried five types of weapons: shields, javelins, wolf-brush spears, long spears, and short swords. The shield bearers protected themselves and their comrades behind them, and initiated the attack by throwing javelins. The wolf-brush spear soldiers stood behind the shield bearers, providing cover for them. Behind the wolf-brush spear soldiers were four long spearmen, who formed the main attacking force, thrusting their spears forward at the enemy. At the rear of the formation were two short sword fighters, whose main task was to protect the flanks of the long spearmen and prevent the enemy from outflanking them. These eleven soldiers cooperated with each other, forming five lines of attack, and since the formation could also change its shape, it greatly enhanced combat effectiveness. The new army was not only well-trained, brave, and skilled in battle, but also strictly disciplined, earning strong support from the people, and even ethnic minorities were willing to fight to the death for it. Because of this, this army repeatedly achieved military successes, striking fear into the hearts of the Japanese pirates, and was honored as the "Qi Family Army."
In the 40th year of the Jiajing era (1561), about ten thousand Japanese pirates raided Taizhou and other areas in Zhejiang. Upon hearing the news, Qi Jiguang immediately deployed troops to resist the pirates and personally led his forces to Ninghai, joining local residents in the fight. The pirates collapsed at the first onslaught of the Qi family army and were forced to retreat to Yanmen Ridge west of Wenzhou, hoping to use the treacherous terrain to defeat the anti-pirate forces. The Qi family army pursued vigorously and, after a fierce battle, annihilated the remaining pirates at Yanmen Ridge. Qi Jiguang then rushed to Taizhou to provide urgent relief. He first ordered his soldiers to attack with firearms, then personally led a large force into the enemy formation, boosting morale so that the soldiers charged fearlessly into battle, undeterred even by the gold and silver the pirates deliberately scattered on the ground. The Qi family army fought with increasing valor and soon wiped out this group of pirates. Shortly after, another band of pirates attempted a surprise attack on Taizhou. Qi Jiguang keenly discerned their intentions and ambushed them at Shangfeng Ridge, a route the pirates had to pass. The pirates suffered heavy casualties and fled in panic to nearby homes, where they were all eliminated by the residents. During his anti-pirate campaigns in Zhejiang, Qi Jiguang achieved nine victories in nine battles, clearing the eastern Zhejiang region of pirates. When the Qi family army returned in triumph, the people of Taizhou formed a welcoming procession over twenty li long to celebrate the victorious return of the anti-pirate hero.
The following year, Japanese pirates (wokou) from Wenzhou in Zhejiang and Nan'ao in Guangdong arrived in Fujian, coordinating with pirates entrenched in the province and causing repeated emergency alerts. Qi Jiguang led his troops back to Fujian, destroying the pirate stronghold at Hengyu (northeast of present-day Ningde). The pirates fled north to Xinghua in Jiangsu. Qi Jiguang pursued and killed countless pirates, receiving a warm welcome from the people of Xinghua. He then returned to Fujian, annihilating two hundred pirates who had landed in Fuqing, and together with fellow anti-pirate general Liu Xian, eliminated the pirates entrenched in Fujian before leading his forces back to Zhejiang.
Shortly after Qi Jiguang returned to Zhejiang, Japanese pirates (wokou) launched a massive invasion of Fujian's coastal regions, capturing Xinghua Prefecture, where they burned, killed, raped, and looted for over two months, leaving the city a deserted ruin before departing. These pirates then attacked and seized Pinghai Guard (present-day Pinghai, Putian, Fujian) via Qitou, once again threatening the people of Fujian. The Ming court appointed Yu Dayou as the new Fujian Regional Commander and summoned Liu Xian, the Guangdong Regional Commander who had previously been sent to aid Fujian, ordering both to join forces with Qi Jiguang to fight the Fujian pirates. The anti-pirate forces engaged in fierce battles with the Japanese pirates in the Putian area of Fujian, killing over 20,000 of them.
Qi Jiguang fought against Japanese pirates along the coasts of Zhejiang, Fujian, and Guangdong for over ten years, experiencing more than eighty battles of various sizes, and finally eliminated the pirate menace from the southeastern coast. After Qi Jiguang's death, the Zhejiang troops, which had originated from the Qi family army, remained the main force of the Ming Dynasty's national defense.
The raids of the Japanese pirates (wokou) severely disrupted the lives of the people and the social economy in the southeastern coastal regions. Only after the pirate menace was pacified could the people live and work in peace and develop production. During the process of suppressing the pirate disturbances, some Ming Dynasty officials realized that the "maritime ban" (haijin) could neither restrict private maritime trade nor prevent the pirates; instead, it forced coastal residents to take risks and collude with the pirates, bringing great harm to the state. In the late Jiajing era, far-sighted officials repeatedly advised the court to lift the maritime ban and develop maritime trade. During the Longqing era (1567–1572), the court abolished the maritime ban, permitting foreign trade, which promoted the development of the commodity economy in the southeastern coastal regions.