Question: When did the 5th Dalai Lama gain political control over the country Lhasa is the capitol of?

full_context: Document 1: 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 2: Tibet: The Tibetan Empire emerged in the 7th century, but with the fall of the empire the region soon divided into a variety of territories. The bulk of western and central Tibet (Ü-Tsang) was often at least nominally unified under a series of Tibetan governments in Lhasa, Shigatse, or nearby locations; these governments were at various times under Mongol and Chinese overlordship. The eastern regions of Kham and Amdo often maintained a more decentralized indigenous political structure, being divided among a number of small principalities and tribal groups, while also often falling more directly under Chinese rule after the Battle of Chamdo; most of this area was eventually incorporated into the Chinese provinces of Sichuan and Qinghai. The current borders of Tibet were generally established in the 18th century.
Document 3: 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.
Document 4: 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 5: 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 6: 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 7: 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 8: Tibet: Standing at 117 metres (384 feet) in height and 360 metres (1,180 feet) in width, the Potala Palace is the most important example of Tibetan architecture. Formerly the residence of the Dalai Lama, it contains over one thousand rooms within thirteen stories, and houses portraits of the past Dalai Lamas and statues of the Buddha. It is divided between the outer White Palace, which serves as the administrative quarters, and the inner Red Quarters, which houses the assembly hall of the Lamas, chapels, 10,000 shrines, and a vast library of Buddhist scriptures. The Potala Palace is a World Heritage Site, as is Norbulingka, the former summer residence of the Dalai Lama.
Document 9: Himalayas: In Hinduism, the Himalayas have been personified as the king of all Mountain – "Giriraj Himavat", father of Ganga and Parvati (form of Adi Shakti Durga).A number of Vajrayana Buddhist sites are situated in the Himalayas, in Tibet, Bhutan and in the Indian regions of Ladakh, Sikkim, Arunachal Pradesh, Spiti and Darjeeling. There were over 6,000 monasteries in Tibet, including the residence of the Dalai Lama. Bhutan, Sikkim and Ladakh are also dotted with numerous monasteries. The Tibetan Muslims have their own mosques in Lhasa and Shigatse.
Document 10: 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 11: Potala Palace: The Potala Palace (Tibetan: ཕོ ་ བྲང ་ པོ ་ ཏ ་ ལ ་, Wylie: pho brang Potala) in Lhasa, Tibet Autonomous Region, China was the residence of the Dalai Lama until the 14th Dalai Lama fled to India during the 1959 Tibetan uprising. It is now a museum and World Heritage Site.
Document 12: Tibet: Tibet (i/tᵻˈbɛt/; Wylie: Bod, pronounced [pʰø̀ʔ]; Chinese: 西藏; pinyin: Xīzàng) is a region on the Tibetan Plateau in Asia. It is the traditional homeland of the Tibetan people as well as some other ethnic groups such as Monpa, Qiang and Lhoba peoples and is now also inhabited by considerable numbers of Han Chinese and Hui people. Tibet is the highest region on Earth, with an average elevation of 4,900 metres (16,000 ft). The highest elevation in Tibet is Mount Everest, earth's highest mountain rising 8,848 m (29,029 ft) above sea level.
Document 13: Kathmandu: Legendary Princess Bhrikuti (7th-century) and artist Araniko (1245 - 1306 AD) from that tradition of Kathmandu valley played a significant role in spreading Buddhism in Tibet and China. There are over 108 traditional monasteries (Bahals and Bahis) in Kathmandu based on Newar Buddhism. Since the 1960s, the permanent Tibetan Buddhist population of Kathmandu has risen significantly so that there are now over fifty Tibetan Buddhist monasteries in the area. Also, with the modernization of Newar Buddhism, various Theravada Bihars have been established.
Document 14: Tibet: There are over 800 settlements in Tibet. Lhasa is Tibet's traditional capital and the capital of Tibet Autonomous Region. It contains two world heritage sites -- the Potala Palace and Norbulingka, which were the residences of the Dalai Lama. Lhasa contains a number of significant temples and monasteries, including Jokhang and Ramoche Temple.
Document 15: 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.
ground_truth: In 1642
sub_queries: lhasa which is being turned into a culturally chinese city is the capital of what country Answer: Tibet
When did the 5th Dalai Lama gain political control over Tibet ? Answer: In 1642