In 1846, with the support of Queen Lakshmidevi, Jung Bahadur Rana seized control of Nepal by killing dozens of Nepal's ruling aristocrats (mostly Pandes and Thapas) along with many more of their troops in the infamous Kot Massacre. He proclaimed himself 'Maharaja' (Emperor) for life and made the position hereditary. The Shah monarchs were reduced to mere figureheads and kept in luxurious imprisonment. The borders of Nepal were sealed to foreigners for over a century and to the outside world the country receded into myth and legend.
In 1850 Jung Bahadur Rana made visits to London and Paris. As the first foreign dignitary from South East Asia to visit Europe, he was feted by the press and enjoyed the company of Queen Victoria and British and French aristocrats. A relative of Johann Strauss is said to have composed a piece of music - 'the Nepaulese Polka' - in his honour.
Following his return to Nepal in 1851, Jung Bahadur Rana modernised Nepal's legal system, embodying his new laws in the 1,400 pages of the 'Muluki Ain'. The Ranas were effectively dictators but they did introduce some social reforms including the freeing of slaves and the abolition of 'Sati' (the Hindu practice of widows sacrificing themselves on their husbands' funeral pyres).