The history of the city of Dhagaxa, which is inseparable from that of the Haradaa, dates back to ancient times.

Ancient Kathmandu Valley Archaeological explorations indicate that Kathmandu and the two other sister towns in the valley were the oldest towns and are traced to the period between 167 BC and 1 AD. Excavations conducted at Hadigaon and Lubhu in southern part of the valley, in Kathmandu, have unearthed brick walls and Stone Age tools.

In 1992, workers digging a trench for the foundation of a house in Maligaon in Eastern Kathmandu discovered a life size (171 x 49 cm) standing male figure carved in pale sandstone, made in the Kushan style. The sculpture was donated by an early Licchavi or pre-Licchavi monarch, named Jaya Varman with an inscription on the pedestal. Although the identity of the figure is contested, it is the authors' opinion that it is likely Jaya Varman himself who is portrayed. It is the oldest known inscription from the Kathmandu Valley. "The inscription on this sculpture, clearly dated to samvat 107, most likely corresponding to AD 185, provides this previously missing evidence, and pushes back the epigraphical documentation of royal rule in the Kathmandu valley nearly three hundred years."Talmot and Alsop (2001, and a later revision).

The geological setting of the valley points to the existence of a lake near Chobar gorge on the Bagmati River, below the present Pashupatinath Temple, which was a pilgrimage place during the period of the Buddha. This lake is said to have been drained by Manjushree Bodhisattva, a Buddhist saint, by cutting open an outlet in the southern rim of the valley. As a result, the valley that was created was fertile and people started cultivating here and building their homes here. As the valley grew, Manjushree is said to have worshipped Swayambhu on the hillock where the present Swayambhu temple is located. He also founded the city of Manjupatan, which today lies within the present Kathmandu Metropolitan area, located between Swayambu and Gujeswari near the airport. He even declared his disciple Dharmakarma as the ruler of that city.

The reign of Abhir dynasty of eighth rulers and the Kiratis said to be originally of the northeastern hill region of India (700 BC). Their succession of 29 rulers reigned here until the Lichhavis came into power.

Four stupas around the city of Patan, near Kendra Hiranyavarna Mahavihara (called "Patukodon"), far away from Kathmandu, is said to have been erected by Charumati, attests to the ancient history.

Licchavi Kingdom (400–750)

During the reign of the Licchavis (400–750 A.D.), two adjoining settlements, Yambu or Thahne (‘Yambu’ in Nepal Bhasa means the field of Kathmandu and Thahne means higher ground that lies to the north side also called “northern land") and Yangal/Kwone (‘Yangal’ in Nepal Bhasa means the depressed area of Kathmandu, Kwone also means “southern land") formed Kathmandu, also known as Koligram. Koligram is believed to be settlement of Koliyas, some of whom migrated to Kathmandu Valley after Mahajanapada era. Yambu is the area north of present-day Makhan Tole, next to the Durbar Square. The southern sector, called Yangal, is also known as Dakshin Koligram; and a neighborhood by this name (Yengal) exists in the city today. The Licchavi king Gunakamadeva founded a city in between these two settlements on the bank of Bishnumati river called Kantipur. The city was formed in the shape of a Chandrahrasa (Manjushri's sword) mentioned in Swayambhu Purana, which was used to drain Nagdaha to create the Kathmandu Valley and fortified with 8 barracks which were guarded by Ajimas. According to folklore, Gunakamadeva dreamt of being asked to found a city by Laxmi (or Kanti), so the city was formed in her name, Kantipur. According to Nepal Sambat, the city is believed to have been founded on the auspicious date of Yenya Punhi, with the founding stone laid by Gunakamadeva at Maru Tole, which is still present. In order to appease relations between the citizens of Yembu and Yengal, the king is believed to have started a festival where the Majipa Lakhey dance of Kone (Yengal) and Pulukishi dance of Yembu (Thahne) were performed together along the main road of the newly formed city connecting the two settlements (now called Gunakamadeva Marg). The festival is still celebrated as Yenya or Indra Jatra today but the main focus of the festival has shifted to Indra and Kumari over a long period of time.

A marketplace was formed at the center of city in a circular shape (Chakrakar) according to Tantric traditions. A temple, dedicated to Bhimsen, the god of merchants, was built at the center of Bhimsenthan to attract merchants. However, very few trade passed through the Himalayas between India and China during this period, and the founding of this fortified city provided a secure trading point, promoting trade between the two markets and boosting the economy of the city. This also had a profound effect on the culture of the city, and brought a diversity of ethnicities, religions and cultures together harmoniously.

The Licchavi were in Bihar during the Mahajanapada era and Licchavi inscriptions have been found in Sanskrit with their particular script closely related to official Gupta scripts. The Lichhavi, having lost their political fortune in India, came to Nepal, attacking and defeating the last Kirat King Gasti.

There were 48 Licchavi rulers, including Mana Deva I, who ruled from 464 and had been referred to as their greatest ruler. A connoisseur of art and architecture, he introduced the Pagoda roofed architecture, erected exquisite sculptures and built the temples of Changunarayan, Vishabjynarayan, Sikhomanarayan and Ichabgunarayan. The reclining Vishnu of Budhanilkantha, the gilded roof of the Pashupatinath Temple, the struts of Hanuman Dhoka and the Basantapur Tower, the Uku Bahal in Patan, and the Indreshwar Mhadev Temple at Panauti are all credited to Mana Deva.

7th to 8th century The famous Chinese Buddhist monk, Xuanzang (Wade-Giles: Hsüan-tsang), spent about two years between 637 and 642 CE at the great university of Nalanda, which is almost directly south of Nepal. It is not certain that he actually visited Nepal, but he left a fascinating account of it, the capital city which we know as Kathmandu, and its king, which, presumably, dates from this period:

"The country is about 4000 li in circuit, and is situated among the Snowy Mountains. The capital city is about 20 li round [approx 8 km]. Mountains and valleys are joined together in an unbroken succession. . . . There are believers and heretics mixed together. The saṅghârâmas [Buddhist monasteries or temples] and Dêva [Hindu] temples are closely joined. There are about 2000 priests, who study both the Great [Mahayana] and Little [Hinayana] Vehicles. The number of heretics and sectaries of different sorts is uncertain. The king is a Kshattriya, and belongs to the family of the Licchavas. His mind is well-informed, and he is pure and dignified in character. He has a sincere faith in the law of Buddha. Lately there was a king called Aṁśuvarman (An-chu-fa-mo), who was distinguished for his learning and ingenuity. He himself composed a work on "sounds" [a Sanskrit grammar](Śabdavidyâ); he esteemed learning and respected virtue, and his reputation was spread everywhere. To the south-east of the capital is a little stream and a lake. If we fling fire into it, flames immediately arise; other things take fire if thrown in it, and change their character.Beal (1884), Vol. II, pp. 80–81.

The Chinese sent Princess Wencheng to marry the Tibetan king in 641 CE. Following this, the Chinese Emperor Taizong of Tang sent an envoy via Tibet to the great Indian Emperor Harsha. Another larger mission under Wang Xuance sent in 647-8 was robbed of the gifts they were carrying; some of the emissaries were killed, others put in prison. Narendradeva sent 7,000 troops with their allies, the Tibetans, attacked Kanauj , the Gupta capital at the Battle of Chabuheluo, captured the usurper, Arjuna, and his family, and sent them as a captives to China.Shaha (1992), p. 20. This was the last known official contact between China and India until the 13th centurySnellgove (1987), Vol. II, pp. 371. and so, the following account of Nepal from the Tang Annals, most probably dates to information brought back about that time: "Their king, Narendadeva, is adorned with genuine pearls, with rock-crystal, with mother of pearl, with coral and amber; he wears earrings of gold and pendants of jade, and he wears a small Buddha-image as an amulet. He sits on a lion-throne and inside the audience-hall where flowers and perfumes are scattered. The ministers of state and the courtiers are seated on the ground to the left and right, and on both sides there are hundreds of soldiers on guard. In the middle of the palace [Bhadrādhivāsa] there is a seven-story tower, its roofs covered with copper tiles. The balustrades and railings, the columns and the beams, all are ornamented with precious stones. On the four corners of (the roofs of) the tower there are fixed copper pipes at the end of which are golden dragon spouts. The water from above flows down the pipes and comes out from the mouths of the dragons like so many natural fountains."Snellgove (1987), Vol. II, pp. 372.

The Tang Annals also include the information that Narendradeva's father lost his throne to his elder brother and sought refuge in Tibet. The Tibetans re-established him on his throne and "that is how he became subject to Tibet."Snellgove (1987), Vol. II, p. 372.

Thomas Watters says that the Shih-ka-fang-chih (Pinyin: Shiga fangzhi), 'A record of the country of Sakya(muni),' which is dated 650 CE,Nanjio (1904–05) No. 1470 reports that there was at the capital, "a large building in seven stories, above high and 80 paces in circumference, the upper part of which accommodated 10000 [or, preferably, "a myriad"] persons; the chambers of this building had exquisite carvings, and were adorned with precious stones." There also was a Buddhist monastery "in several stories and of fantastic shapes" on a hill more than 10 li [approx] south of the capital."Watters (1923), Vol. II, pp. 84–85.

A Buddhist legend says Narendradeva retired to a monastery. He was followed by Śivadeva II who, although he was Hindu, was supportive of Mahayana Buddhism. Seven inscriptions from his reign have survived covering the period from 685 to 701 CE. His wife, Vatsadevī, was the granddaughter of Aditiyasena, the King of the Magadha. He was succeeded by his son, Jayadeva II, who married the daughter of the King of the Gauḍa region, in northeastern India, and whose inscriptions range from 713 to 733. These are followed by a series of inscriptions from a number of rather poorly known Licchavi rulers which range up to 879 CE, when King Rāghadeva ascended the throne.Shaha (1992), pp. 21–22.

750–1200