Around 1400 AD, , Ajai Pal, brough all the minor principalities for the Garhwal region, under his own rule, and founded the Garhwal kingdom. He and his ancestors ruled over Garhwal and the adjacent state of Tehri, in an uninterrupted line till 1803, when the Gurkhas invaded Kumaon and Garhwal, driving the Garhwal chief into the plains.
For twelve years the Gurkhas ruled the country with a rod of iron, until a series of encroachments by them on British territory led to the war with Nepal in 1814. At the termination of the campaign, Garhwal and Kumaon were converted into British districts, while the Tehri principality was restored to a son of the former chief .