After first spending six years in the Portuguese colony of
Goa, Magalhães arrived in Hangzhou in 1640. He was then sent to
Chengdu in
Sichuan and arrived in August 1642. He began a close association with fellow Jesuit
Lodovico Buglio in Chengdu, and started to study Chinese under Buglio's guidance. Buglio would become his biographer 35 years later. Both Magalhães and Buglio were pressed to serve under the rebel "King of the West",
Zhang Xianzhong () after Zhang captured Sichuan in 1644. Initially Magalhães wrote sympathetically of Zhang's attempts at empire-building in Chengdu, but became fearful when Zhang started his campaign of terror in Sichuan. They were taken to the
Forbidden City in
Peking in 1648 where they were well received by the
Shunzhi emperor, and were given a church, house and income. He and Buglio undertook the construction of the original St. Joseph's Church in Peking (originally known as
Dong Tang or Eastern Church). Magalhães was given the duty of maintaining various Western machinery, including the clocks at the court of the
Shunzhi and
Kangxi emperors. He built a number of mechanical devices, including a
carillon and
turret clock that played a Chinese tune on the hour. After the death of the Shunzhi emperor, anti-Christian sentiments surfaced, and in 1661, during the reign of the Kangxi emperor, Magalhães was charged with bribery. He was imprisoned and tortured, but later released as the charges were not sustained. Magalhães died in Peking on 6 May 1677 and the Kangxi emperor himself wrote Magalhães' eulogy, and granted his estate 200 taels of silver and ten large bolts of silk. He was buried in the Jesuits'
Zhalan Cemetery in Beijing. ==Works==