The region was originally settled by Kols, an aboriginal people of the Dravidian physical type who were later joined by Indo-Aryan Khas tribes that arrived from the northwest by the Vedic period. At that time, present-day Uttarakhand also served as a haunt for Rishis and Sadhus. It is believed that Sage Vyasa scripted the Mahabharata here as the Pandavas are believed to have traveled and camped in the region. Among the first major dynasties of Garhwal and Kumaon were the Kunindas in the 2nd century B.C. who practiced an early form of Shaivism. They traded salt with Western Tibet. It is evident from the Ashokan edict at Kalsi, near Dehradun in Western Garhwal that Buddhism made inroads in this region. Folk shamanic practices deviating from Hindu orthodoxy also persisted here. However, Garhwal and Kumaon were restored to nominal Brahmanical rule due to the travails of Shankaracharya and the arrival of migrants from the plains. In the fourth century, the Kunindas gave way to the Naga Dynasties. Between the 7th and 14th centuries, the Katyuri dynasty of Khas origin dominated lands of varying extent from the Katyur (modern day Baijnath) valley in Kumaon. Other peoples of the Tibeto-Burman group known as Kiratas are thought to have settled in the northern highlands as well as in pockets throughout the region, and believed to be the ancestors to the modern day Bhotiya, Raji, Buksha, and Tharu peoples.
By the medieval period, the region was consolidated under the Garhwal Kingdom in the west and the Kumaon Kingdom in the east. From the 13th-18th century, Kumaon prospered under the Chand Rajas who had their origins in the plains of India. During this period, learning and new forms of painting (the Pahari school of art) developed. Modern-day Garhwal was likewise unified under the rule of Parmar/Panwar Rajas, who along with a mass migration of Brahmins and Rajputs, also arrived from the plains. In 1791, the expanding Gurkha Empire of Nepal, overran Almora, the seat of the Kumaon Kingdom. In 1803, the Garhwal Kingdom also fell to the Gurkhas. With the conclusion of the Anglo-Nepalese War in 1816, a rump portion of the Garhwal Kingdom was reestablished from Tehri, and eastern British Garhwal and Kumaon ceded to the British as part of the Treaty of Sugauli.