Nepal was ruled by monarchs of the Shah dynasty from 1768 till the abolition of monarchy in 2008.
However, from 1846 until the 1951 revolution, the country was de facto ruled by the hereditary prime ministers of the Rana dynasty, reducing the role of the Shah monarch to that of a figurehead.
[2][3] Under the interim constitution adopted in January 2007, all powers of governance were removed from the king, and the Constituent Assembly elected in 2008 was to decide in its first meeting whether to continue the monarchy or to declare a republic.
During the suspension of the monarchy, Girija Prasad Koirala, then Prime Minister of Nepal, acted as the Head of State.
Ram Baran Yadav was elected by the Constituent Assembly, and was sworn in as the nation's first president on 23 July 2008.