Prithvi Narayan Shah unified a collection of small, competing principalities into a single state, laying the foundation for modern Nepal in the mid-18th century. As the ruler of the Gorkha principality, he launched a unification campaign against the fragmented Malla kingdoms of the Kathmandu Valley and other rival states. His successful campaign established the Gorkha Kingdom and, eventually, the modern nation of Nepal, for which he is considered its visionary founder.