When Zhu Yuanzhang became the founding emperor of the Ming dynasty, he bestowed upon the Qi family the hereditary post of commander-in-chief of Dengzhou Garrison, a district of the present day Penglai.
As a child, he built ramparts from clay, piled up rubble to form barracks, and made flags from bamboo sticks and paper to play war games with his friends and himself as the commander.
During this time, Mongol troops led by Altan Khan broke through the northern defenses and laid siege to Beijing.
Qi Jiguang twice submitted defense proposals to the emperor and was noted to have displayed extraordinary valor and military cunning during the battle, and saw the defeat of the invaders.
In 1553, Qi Jiguang was promoted to Assistant Regional Military Commissioner (都指揮僉事) of Shandong's defense force against wokou pirates.
Together with two other generals, Yu Dayou and Tan Lun, Qi led Ming forces to a decisive victory at Cen Harbor (岑港) in 1558.
Within two months, his army had eradicated three major lairs of wokou pirates at Hengyu (橫嶼), Niutian (牛田) and Lindun (林墩).
In September 1565, a major battle against wokou pirates was fought on the island of Nan'ao, which lies near the boundary between the provinces of Fujian and Guangdong.
There Qi joined arms with his old comrade Yu Dayou again to defeat the remnant of the combined Japanese and Chinese pirate force.
After eliminating the pirate threat, Qi Jiguang was called to Beijing in late 1567 to take charge of training the imperial guards.
In 1571, the Ming dynasty bestowed the title "Lord Shunyi" (順義王) upon Altan Khan and established trade with the Mongols.
During the early reign of the Wanli Emperor (1570s), the Mongol army led by Dong Huli, chieftain of the Duoyan tribe, continuously invaded the Ming territory.
When Dong Huli brought his nephew and 300 clansmen to beg tearfully for mercy at the outpost, Qi Jiguang accepted their surrender.
A type of hard pancake called guangbing (光餅, Foochow Romanized: guŏng-biāng, known as kompyang in Malaysia and Indonesia) was named after Qi Jiguang.