Question: When did the 5th Dalai Lama gain control over the country the Ming traded horses with?

full_context: Document 1: Sino-Tibetan relations during the Ming dynasty: Tsai writes that shortly after the visit by Deshin Shekpa, the Yongle Emperor ordered the construction of a road and of trading posts in the upper reaches of the Yangzi and Mekong Rivers in order to facilitate trade with Tibet in tea, horses, and salt. The trade route passed through Sichuan and crossed Shangri-La County in Yunnan. Wang and Nyima assert that this "tribute-related trade" of the Ming exchanging Chinese tea for Tibetan horses—while granting Tibetan envoys and Tibetan merchants explicit permission to trade with Han Chinese merchants—"furthered the rule of the Ming dynasty court over Tibet". Rossabi and Sperling note that this trade in Tibetan horses for Chinese tea existed long before the Ming. Peter C. Perdue says that Wang Anshi (1021–1086), realizing that China could not produce enough militarily capable steeds, had also aimed to obtain horses from Inner Asia in exchange for Chinese tea. The Chinese needed horses not only for cavalry but also as draft animals for the army's supply wagons. The Tibetans required Chinese tea not only as a common beverage but also as a religious ceremonial supplement. The Ming government imposed a monopoly on tea production and attempted to regulate this trade with state-supervised markets, but these collapsed in 1449 due to military failures and internal ecological and commercial pressures on the tea-producing regions.
Document 2: Sino-Tibetan relations during the Ming dynasty: Laird writes that Altan Khan abolished the native Mongol practices of shamanism and blood sacrifice, while the Mongol princes and subjects were coerced by Altan to convert to Gelug Buddhism—or face execution if they persisted in their shamanistic ways. Committed to their religious leader, Mongol princes began requesting the Dalai Lama to bestow titles on them, which demonstrated "the unique fusion of religious and political power" wielded by the Dalai Lama, as Laird writes. Kolmaš states that the spiritual and secular Mongol-Tibetan alliance of the 13th century was renewed by this alliance constructed by Altan Khan and Sönam Gyatso. Van Praag writes that this restored the original Mongol patronage of a Tibetan lama and "to this day, Mongolians are among the most devout followers of the Gelugpa and the Dalai Lama." Angela F. Howard writes that this unique relationship not only provided the Dalai Lama and Panchen Lama with religious and political authority in Tibet, but that Altan Khan gained "enormous power among the entire Mongol population."
Document 3: Sino-Tibetan relations during the Ming dynasty: The Mongol prince Godan, a grandson of Genghis Khan, raided as far as Lhasa. During his attack in 1240, Prince Godan summoned Sakya Pandita (1182–1251), leader of the Sakya school of Tibetan Buddhism, to his court in what is now Gansu in Western China. With Sakya Pandita's submission to Godan in 1247, Tibet was officially incorporated into the Mongol Empire during the regency of Töregene Khatun (1241–1246). Michael C. van Walt van Praag writes that Godan granted Sakya Pandita temporal authority over a still politically fragmented Tibet, stating that "this investiture had little real impact" but it was significant in that it established the unique "Priest-Patron" relationship between the Mongols and the Sakya lamas.
Document 4: Sino-Tibetan relations during the Ming dynasty: Laird writes that the Ming appointed titles to eastern Tibetan princes, and that "these alliances with eastern Tibetan principalities are the evidence China now produces for its assertion that the Ming ruled Tibet," despite the fact that the Ming did not send an army to replace the Mongols after they left Tibet. Yiu Yung-chin states that the furthest western extent of the Ming dynasty's territory was Gansu, Sichuan, and Yunnan while "the Ming did not possess Tibet."
Document 5: Sino-Tibetan relations during the Ming dynasty: Kolmaš writes that, as the Mongol presence in Tibet increased, culminating in the conquest of Tibet by a Mongol leader in 1642, the Ming emperors "viewed with apparent unconcern these developments in Tibet." He adds that the Ming court's lack of concern for Tibet was one of the reasons why the Mongols pounced on the chance to reclaim their old vassal of Tibet and "fill once more the political vacuum in that country." On the mass Mongol conversion to Tibetan Buddhism under Altan Khan, Laird writes that "the Chinese watched these developments with interest, though few Chinese ever became devout Tibetan Buddhists."
Document 6: Sino-Tibetan relations during the Ming dynasty: Historians Luciano Petech and Sato Hisashi argue that the Ming upheld a "divide-and-rule" policy towards a weak and politically fragmented Tibet after the Sakya regime had fallen. Chan writes that this was perhaps the calculated strategy of the Yongle Emperor, as exclusive patronage to one Tibetan sect would have given it too much regional power. Sperling finds no textual evidence in either Chinese or Tibetan sources to support this thesis of Petech and Hisashi. Norbu asserts that their thesis is largely based on the list of Ming titles conferred on Tibetan lamas rather than "comparative analysis of developments in China and Tibet." Rossabi states that this theory "attributes too much influence to the Chinese," pointing out that Tibet was already politically divided when the Ming dynasty began. Rossabi also discounts the "divide-and-rule" theory on the grounds of the Yongle Emperor's failed attempt to build a strong relationship with the fifth Karmapa—one which he hoped would parallel Kublai Khan's earlier relationship with the Sakya Phagpa lama. Instead, the Yongle Emperor followed the Karmapa's advice of giving patronage to many different Tibetan lamas.
Document 7: Sino-Tibetan relations during the Ming dynasty: Chen states that the fourth Dalai Lama Yonten Gyatso was granted the title "Master of Vajradhara" and an official seal by the Wanli Emperor in 1616. This was noted in the Biography of the Fourth Dalai Lama, which stated that one Soinam Lozui delivered the seal of the Emperor to the Dalai Lama. The Wanli Emperor had invited Yonten Gyatso to Beijing in 1616, but just like his predecessor he died before being able to make the journey.
Document 8: Sino-Tibetan relations during the Ming dynasty: Of the third Dalai Lama, China Daily states that the "Ming dynasty showed him special favor by allowing him to pay tribute." China Daily then says that Sonam Gyatso was granted the title Dorjichang or Vajradhara Dalai Lama in 1587 [sic!], but China Daily does not mention who granted him the title. Without mentioning the role of the Mongols, China Daily states that it was the successive Qing dynasty which established the title of Dalai Lama and his power in Tibet: "In 1653, the Qing emperor granted an honorific title to the fifth Dalai Lama and then did the same for the fifth Panchen Lama in 1713, officially establishing the titles of the Dalai Lama and the Panchen Erdeni, and their political and religious status in Tibet."
Document 9: Sino-Tibetan relations during the Ming dynasty: Meanwhile, the Tumed Mongols began moving into the Kokonor region (modern Qinghai), raiding the Ming Chinese frontier and even as far as the suburbs of Beijing under Altan Khan (1507–1582). Klieger writes that Altan Khan's presence in the west effectively reduced Ming influence and contact with Tibet. After Altan Khan made peace with the Ming dynasty in 1571, he invited the third hierarch of the Gelug—Sönam Gyatso (1543–1588)—to meet him in Amdo (modern Qinghai) in 1578, where he accidentally bestowed him and his two predecessors with the title of Dalai Lama—"Ocean Teacher". The full title was "Dalai Lama Vajradhara", "Vajradhara" meaning "Holder of the Thunderbolt" in Sanskrit. Victoria Huckenpahler notes that Vajradhara is considered by Buddhists to be the primordial Buddha of limitless and all-pervasive beneficial qualities, a being that "represents the ultimate aspect of enlightenment." Goldstein writes that Sönam Gyatso also enhanced Altan Khan's standing by granting him the title "king of religion, majestic purity". Rawski writes that the Dalai Lama officially recognized Altan Khan as the "Protector of the Faith".
Document 10: Tibet: The 5th Dalai Lama is known for unifying the Tibetan heartland under the control of the Gelug school of Tibetan Buddhism, after defeating the rival Kagyu and Jonang sects and the secular ruler, the Tsangpa prince, in a prolonged civil war. His efforts were successful in part because of aid from Güshi Khan, the Oirat leader of the Khoshut Khanate. With Güshi Khan as a largely uninvolved overlord, the 5th Dalai Lama and his intimates established a civil administration which is referred to by historians as the Lhasa state. This Tibetan regime or government is also referred to as the Ganden Phodrang.
Document 11: Sino-Tibetan relations during the Ming dynasty: With the example of the Ming court's relationship with the fifth Karmapa and other Tibetan leaders, Norbu states that Chinese Communist historians have failed to realize the significance of the religious aspect of the Ming-Tibetan relationship. He writes that the meetings of lamas with the Emperor of China were exchanges of tribute between "the patron and the priest" and were not merely instances of a political subordinate paying tribute to a superior. He also notes that the items of tribute were Buddhist artifacts which symbolized "the religious nature of the relationship." Josef Kolmaš writes that the Ming dynasty did not exercise any direct political control over Tibet, content with their tribute relations that were "almost entirely of a religious character." Patricia Ann Berger writes that the Yongle Emperor's courting and granting of titles to lamas was his attempt to "resurrect the relationship between China and Tibet established earlier by the Yuan dynastic founder Khubilai Khan and his guru Phagpa." She also writes that the later Qing emperors and their Mongol associates viewed the Yongle Emperor's relationship with Tibet as "part of a chain of reincarnation that saw this Han Chinese emperor as yet another emanation of Manjusri."
Document 12: Sino-Tibetan relations during the Ming dynasty: While the Ming dynasty traded horses with Tibet, it upheld a policy of outlawing border markets in the north, which Laird sees as an effort to punish the Mongols for their raids and to "drive them from the frontiers of China." However, after Altan Khan (1507–1582)—leader of the Tümed Mongols who overthrew the Oirat Mongol confederation's hegemony over the steppes—made peace with the Ming dynasty in 1571, he persuaded the Ming to reopen their border markets in 1573. This provided the Chinese with a new supply of horses that the Mongols had in excess; it was also a relief to the Ming, since they were unable to stop the Mongols from periodic raiding. Laird says that despite the fact that later Mongols believed Altan forced the Ming to view him as an equal, Chinese historians argue that he was simply a loyal Chinese citizen. By 1578, Altan Khan formed a formidable Mongol-Tibetan alliance with the Gelug that the Ming viewed from afar without intervention.
Document 13: Sino-Tibetan relations during the Ming dynasty: The Ming initiated sporadic armed intervention in Tibet during the 14th century, but did not garrison permanent troops there. At times the Tibetans also used armed resistance against Ming forays. The Wanli Emperor (r. 1572–1620) made attempts to reestablish Sino-Tibetan relations after the Mongol-Tibetan alliance initiated in 1578, which affected the foreign policy of the subsequent Qing dynasty (1644–1912) of China in their support for the Dalai Lama of the Gelug school. By the late 16th century, the Mongols were successful armed protectors of the Gelug Dalai Lama, after increasing their presence in the Amdo region. This culminated in Güshi Khan's (1582–1655) conquest of Tibet from 1637–1642 and the establishment of the Ganden Phodrang regime by the 5th Dalai Lama with his help.
Document 14: Sino-Tibetan relations during the Ming dynasty: Discussions of strategy in the mid Ming dynasty focused primarily on recovery of the Ordos region, which the Mongols used as a rallying base to stage raids into Ming China. Norbu states that the Ming dynasty, preoccupied with the Mongol threat to the north, could not spare additional armed forces to enforce or back up their claim of sovereignty over Tibet; instead, they relied on "Confucian instruments of tribute relations" of heaping unlimited number of titles and gifts on Tibetan lamas through acts of diplomacy. Sperling states that the delicate relationship between the Ming and Tibet was "the last time a united China had to deal with an independent Tibet," that there was a potential for armed conflict at their borders, and that the ultimate goal of Ming foreign policy with Tibet was not subjugation but "avoidance of any kind of Tibetan threat." P. Christiaan Klieger argues that the Ming court's patronage of high Tibetan lamas "was designed to help stabilize border regions and protect trade routes."
Document 15: Sino-Tibetan relations during the Ming dynasty: Rawski writes that Altan Khan's conversion to the Gelug "can be interpreted as an attempt to expand his authority in his conflict with his nominal superior, Tümen Khan." To further cement the Mongol-Tibetan alliance, the great-grandson of Altan Khan—the 4th Dalai Lama (1589–1616)—was made the fourth Dalai Lama. In 1642, the 5th Dalai Lama (1617–1682) became the first to wield effective political control over Tibet.
ground_truth: In 1642
sub_queries: Who did the Ming trade horses with? Answer: Tibet
When did the 5th Dalai Lama gain political control over Tibet ? Answer: In 1642