Before the unification of the whole Nepal, the small kingdom was ruled by Kirants, Lichhavis, Thakuris and Mallas. The Kathmandu valley was developed into a well administrative country with large army and own currencies by the 16th century. During the reign of the Mallas, Prithvi Narayan Shah of Gorkha kingdom invaded in 1768 taking advantage of the disputes in the valley and thus unifying Nepal and then establishing the rule of Shah Dynasty in Nepal.
Later in 1844, Jung BahadurRana revolted against the royalties in the kingdom and the historical Kot Massacre took place in the palace. Then the Rana took the total power keeping the Shah family in the background. The Rana regime brought many reforms including the end to slavery. Many schools, colleges and hospitals were established and newspaper press was started. But due to their autocratic rule the reign came to an end. It was in 1950 when King Tribhuwan overthrew the Ranas and restored democracy with the support of large number of people and the shah rule was established again.
King Birendra was considered the most noble and peaceful king of Nepal. Unfortunately, king Birendra and his whole family including the crown prince died in the Royal Palace Massacre in 2001. The late king’s brother Gyanendra was crowned as the next king of Nepal. The decade long People’s Revolution by Maoists (Communist party of Nepal) and several week long mass protests by majority of party and people against the direct royal rule signed a peace agreement in 2006 and dethroned king Gyanendra Shah, thus establishing the present day Federal Democratic Republic of Nepal.
Maoists joined the interim government and came into the political mainstream. Ram BaranYadav became the first president of Nepal. A coalition government was formed for drafting the new constitution. A UN peace monitoring mission was held that ended in January 2011. In 2013 the election for an assembly which will write a new constitution was won by the Nepali congress party with majority of seats.