Before Shah dynasty took over Nepal, Nepal was limited to Kathmandu valley and surrounding territories which consist many kingdoms. After conquering the valley in the mid-eighteenth century, King Prithvi Narayan Shah moved his ruling state to Nepal from Gorkha. He then started his conquering campaign with the banner of Nepal than Gorkha. With this conquer, Nepal was expanded covering more area forming the shape of modern Nepal.
King Prithvi Narayan Shah (1723–1775) was born in the Shah dynasty of Gorkha on 11 January 1723 (27 Poush 1779 BS) After the death of Narabhupal Shah on 25 Chaitra he became the king of Gorkha. He ascended to the throne of Gorkha kingdom on 3 April 1743. He was interested in politics and diplomacy and had interests in both visiting and conquering other countries since his days as prince. He decided to enlarge his kingdom, which was confined to the small Gorkha region of present-day Nepal and had an area of just 2,500 square km. He defeated major principalities in wars and unified them under his rule starting from the 1740s, and eventually moved his Gorkha Kingdom's capital from Gorkha region to Kathmandu in 1769. While he was successful at conquering the Kathmandu valley and the Sen kingdoms further east, his efforts were limited in the west of his homeland. He then attacked and absorbed dozens of other small principalities and gave a new name "Nepal" to his Gorkha kingdom. He conquered some of the 22 principalities or kingdoms, known as the (thebaise raj-ya, and some of the 24 kingdoms (the chaubasi raj-ya), which were two sets of allies west of the King's homeland of Gorkha, in what is now called western Nepal.
Kalu Pandey employed a strategy involving a blockade of the Kathmandu Valley, and subsequently took over the surrounding settlements and strategic positions around the valley. In the next two years (during 1745-46) he captured Mahadevpokhari, Pharping, Chitlang, Dharmasthali, Naldrum, Siranchok and Shivapuri. He then focused his attention on Kirtipur and Makawanpur, two palaces which were also strategic military targets. Kirtipur was in an elevated position with a fort surrounded by walls and jungles, an ideal place to make inroads into the valley. Shah thought that if he could take over Kirtipur, occupying the rest of the valley would be much easier. On 4 December 1757 he made his first attack on Kirtipur. In this war he lost his strong general Kalu pandey which was a great loss for gorkha. Kalu Pandey had told him that it was not the right time to attack Kritpur. His body was buried in Kirtipur. Prithvi Narayan Shah himself was nearly killed in the battle. As a result, the Gorkha army, having lost a great deal of morale, was defeated. It is said that as revenge for his two earlier defeats, The Gorkha army was repelled again in August 1765.