Meanwhile, Rajrajeshowri, fed up of her debauch husband, left Varanasi, entered the border of Nepal on 26 July 1801, and taking advantage of the weak regency, was slowly making her way towards Kathmandu with the view of taking over the regency. Back in Kathmandu the court politics turned complicated when Mul Kaji (or chief minister) Kirtiman Singh Basnet, a favorite of the Regent Subarnaprabha, was secretly assassinated on 28 September 1801, by the supporters of Rajrajeswori. In the resulting confusion many courtiers were jailed, while some executed, based solely on rumors. Bakhatbar Singh Basnet, brother of assassinated Kirtiman Singh, was then given the post of mul kaji During his tenure as the mul kaji, on 28 October 1801, a Treaty of Commerce and Alliance was finally signed between Nepal and East India Company that led to the establishment of the first British Resident, Captain William O. Knox, who was reluctantly welcomed by the courtiers in Kathmandu on 16 April 1802. The primary objective of Knox's mission was to bring the trade treaty of 1792 into full effect and to establish a "controlling influence" in Nepali politics. Almost eight months after the establishment of the Residency, Rajrajeshowri finally managed to assume the regency on 17 December 1802.
