By the late Vedic period, Nepal was being mentioned in various Hindu texts, such as the late Vedic Atharvaveda Pariśiṣṭa and in the post-Vedic Atharvashirsha Upanishad.
Around 600 BC, small kingdoms and confederations of clans arose in the southern regions of Nepal. From one of these, the Shakya polity, arose a prince who later renounced his status to lead an ascetic life, founded Buddhism, and came to be known as Gautama Buddha (traditionally dated 563–483 BC).
Nepal came to be established as a land of spirituality and refuge in the intervening centuries, played an important role in transmitting Buddhism to East Asia via Tibet, and helped preserve Hindu and Buddhist manuscripts.
By 250 BC, the southern regions had come under the influence of the Maurya Empire. Emperor Ashoka made a pilgrimage to Lumbini and erected a pillar at Buddha’s birthplace, the inscriptions on which mark the starting point for properly recorded history of Nepal. Ashoka also visited the Kathmandu valley and built monuments commemorating Gautam Buddha’s visit there. By the 4th century AD, much of Nepal was under the influence of the Gupta Empire. Several other empires would claim control over what is now Nepal into the 11th century.
In the 11th century, a powerful empire of Khas people emerged in western Nepal whose territory at its highest peak included much of western Nepal as well as parts of western Tibet and Uttarakhand of India. By the 14th century, the empire had splintered into loosely associated Baise rajyas, literally 22 states as they were counted. The rich culture and language of the Khas people spread throughout Nepal and as far as Indo-China in the intervening centuries; their language, later renamed the Nepali language, became the lingua franca of Nepal as well as much of North-east India.
In the Kathmandu valley, the Mallas, who make several appearances in Nepalese history since ancient times, had established themselves in Kathmandu and Patan by the middle of the 14th century. By the middle of the 15th century, Kathmandu had become a powerful empire which extended from Digarchi or Sigatse in Tibet to Tirhut and Gaya in India. In the late 15th century, Malla princes divided their kingdom in four – Kathmandu, Patan and Bhaktapur in the valley and Banepa to the east. The competition for prestige among these brotherly kingdoms saw the flourishing of art and architecture in central Nepal, and the building of famous Kathmandu, Patan and Bhaktapur Durbar Squares; their division and mistrust led to their fall in the late 18th century, and ultimately, the unification of Nepal into a modern state.
Kingdom of Nepal:
The Gorkha control reached its height when the North Indian territories of the Kumaon and Garhwal Kingdoms in the west to Sikkim in the east came under Nepalese control. A dispute with Tibet over the control of mountain passes and inner Tingri valleys of Tibet forced the Qing Emperor of China to start the Sino-Nepali War compelling the Nepali to retreat to their own borders in the north. The rivalry between the Kingdom of Nepal and the East India Company over the control of states bordering Nepal eventually led to the Anglo-Nepali War (1815–16). At first, the British underestimated the Nepali and were soundly defeated until committing more military resources than they had anticipated needing. Thus began the reputation of Gurkhas as fierce and ruthless soldiers. The war ended in the Sugauli Treaty, under which Nepal ceded recently captured lands.