Bhutan's early history is steeped in mythology and remains obscure. Some of the structures provide evidence that the region has been settled as early as 2000 BC. According to a legend it was ruled by a Cooch-Behar king, Sangaldip, around the 7th century BC, but not much is known prior to the introduction of Tibetan Buddhism in the 9th century, when turmoil in Tibet forced many monks to flee to Bhutan. In the 12th century, the Drukpa Kagyupa school was established and remains the dominant form of Buddhism in Bhutan today. The country's political history is intimately tied to its religious history and relations among the various monastic schools and monasteries.Bhutan is one of only a few countries which has been independent throughout her history, never conquered, occupied, or governed by an outside power (notwithstanding occasional nominal tributary status). Although there has been speculation that it was under the Kamarupa Kingdom or the Tibetan Empire in the 7th to 9th centuries, firm evidence is lacking. From the time historical records are clear, Bhutan has continuously and successfully defended its sovereignty.The consolidation of Bhutan occurred in 1616 when Ngawanag Namgyal, a lama from western Tibet known as the Zhabdrung Rinpoche, defeated three Tibetan invasions, subjugated rival religious schools, codified the Tsa Yig, an intricate and comprehensive system of law, and established himself as ruler over a system of ecclesiastical and civil administrators. After his death, infighting and civil war eroded the power of the Zhabdrung for the next 200 years. In 1885 Ugyen Wangchuck was able to consolidate power, and began cultivating closer ties with the British in the subcontinent.In 1907, Ugyen Wangchuck was elected as the hereditary ruler of Bhutan, crowned on December 17, 1907, and installed as the head of state, the Druk Gyalpo (Dragon King). In 1910, King Ugyen and the British signed the Treaty of Punakha which provided that British India would not interfere in the internal affairs of Bhutan if the country accepted external advice in its external relations. When Ugyen Wangchuck died in 1926, his son Jigme Wangchuck became the ruler, and when India gained independence in 1947, the new Indian Government recognized Bhutan as an independent country. In 1949, India and Bhutan signed the Treaty of Peace and Friendship, which provided that India would not interfere in Bhutan's internal affairs, but would guide its foreign policy. Succeeded in 1952 by his son Jigme Dorji Wangchuck, Bhutan began to slowly emerge from its isolation and began a program of planned development. The National Assembly of Bhutan, the Royal Bhutanese Army, and the Royal Court of Justice were established, along with a new code of law. Bhutan became a member of the United Nations in 1971. In 1972, Jigme Singye Wangchuck ascended the throne at age 16. He emphasized modern education, decentralization of governance, the development of hydroelectricity and tourism and improvements in rural developments. He was perhaps best known internationally for his overarching development philosophy of "gross national happiness." It recognizes that there are many dimensions to development and that economic goals alone are not sufficient. Satisfied with Bhutan's transitioning democratization process, he abdicated in December 2006 rather than wait until the promulgation of the new constitution in 2008. His son, Jigme Khesar Namgyel Wangchuck, became King upon his abdication.