After these events, the following dynasties have ruled the Kathmandu Valley: the Kirat dynasty; the Licchavi dynasty from 464 AD; the Malla dynasty between the 12 and 17 th centuries; Prithvi Narayan Shah invaded Nepal and his dynasty started to rule it from 1758- the birth of modern Nepal.
During the Anglo-Nepalese war (1815-16), parts of Nepal (e.g, Sikkim) were annexed by the British East India Company in return for Nepal to have complete autonomy of its own. From 1846, Jung Bahadur came to power and founded the Rana dynasty, which came to be pro-British and supported Britain during the 1857 Sepoy Mutiny in India, and the two world wars. In 1923, the UK and Nepal signed a friendship agreement, in which the UK recognised Nepal as an independent nation.