Zheng He's ancestors are said to be from modern day Uzbekistan. They migrated to China during an invasion by a neighboring country during the Song Dynasty. Once they settled in China, they adopted the surname "Ma" (馬) which is phonetically similar to the first syllable of Mohammed. Zheng He's great-great-great-grandfather, Saiyid Ajall Shams al-Din, was a personal guard of Genghis Khan and, later on in his life, became the governor of Yunnan. He was posthumously recognized as the "King of Xianyang".
In 1371, a respected and wealthy Muslim Hajji, Mer Tekin, and his wife gave birth to a young child named Ma He in the He Dai village of modern day Jinning in Yunnan province. (known as Kunyang at the time) He was given the name He (和), which meant peace, as he was born during a time when Yunnan was constantly threatened by Mongolian rebels. Ma He had an elder brother named Wenming, as well as four other sisters. All the children were devoted to religion and learnt Arabic, as they were in a Muslim household.
Things took an unexpected turn in 1381, when the Ming army intending to bring down the Mongol empire, made a stop in Yunnan, then Mongolian soil. The army destroyed Kunyang and captured some men, including an 11-year-old Ma He. The army was lead by General Fu Youde and Lan Yushuai. Fu interrogated Ma He as to the whereabouts of a Mongol pretender hiding in the village. Ma He replied that the pretender jumped down a well. Unimpressed by his rather silly answer, Fu Youde imprisoned him for 3 years. Ma He's father was killed in 1382.
In 1384, Fu Youde sent 400 captured, castrated conscripts to Nanjing. Ma He was among the boys who were sent. Ma He's intelligence was recognized by prison guards as well as officials, who brought him to the royal palace. He was given the task of building a treasure city for the emperor and tombs for other ministers. Having exceptionally completed the project, he was then assigned to handle the funeral of General Xuda. The general's daughter, also the wife of the Prince of Yan, Zhu Di, was so impressed that Ma He was chosen to go to Beijing to become a servant to Prince Zhu Di. (For more information on the prince, please refer to "Zhu Di".) Ma He served as a close confidant and aide to the Prince of Yan. (Zhu Di's royal name) In a particular incident, Ma even rescued the prince's son from drowning in a river. Ma He would then become a eunuch, dedicating his entire life to serving the royal family, then the rest of the Chinese civilization.