The company was unavoidably drawn into war with Mysore in 1790. Tipu Sultan, Mysore's ruler, had expressed contempt for the British not long after signing the 1784 Treaty of Mangalore, and also expressed a desire to renew conflict with them. In late 1789 he invaded the Kingdom of Travancore, a company ally according to that treaty, because of territorial disputes and Travancore's harbouring of refugees from other Mysorean actions. Cornwallis ordered company and Crown troops to mobilize in response. The 1790 campaign against Tipu was conducted by General William Medows, and it was a limited success. Medows successfully occupied the Coimbatore district, but Tipu counterattacked and was able to reduce the British position to a small number of strongly held outposts. Tipu then invaded the Carnatic, where he attempted unsuccessfully to draw the French into the conflict. Because of Medows' weak campaigning, Cornwallis personally took command of the British forces in 1791.