Napoleon's landing in Egypt in 1798 was intended to intimidate India. Mysore was a key to that next step, as the ruler of Mysore, Tipu Sultan, was a steadfast ally of the French. Although Napoleon's ambitions were crushed at the Battle of the Nile, yet three armies, one from Bombay and two British (one of which comprised a division that was commanded by Colonel Arthur Wellesley), nonetheless marched into Mysore in 1799. There, the force besieged the capital, Seringapatam (present day Srirangapatnam, Karnataka), after some engagements with the Tipu Sultan's armies.
On 6th March 1799, Tipu Sultan unsuccessfully attacked Stuart in Sedaseer, losing 1500 men in the process. Tipu failed again on 27 March at Malavelly when he engaged Harris' force and lost 700 men. On 4th May, following Tipu's rejection of surrender terms, the British, led by General Baird, stormed and captured the fortress at Seringapatam (Srirangapatnam). The British suffered about 1500 killed, wounded and missing and the Mysorians had about 8,000 killed. The list included Tipu Sultan himself.
Tipu Sultan was betrayed in the Fourth Mysore War by one of his commanders, Mir Sadiq, a double-crosser who was bribed by the British. Sadiq had sent the army to collect wages at the height of the battle. This move thus paved way for the British to seize a chance to enter through the hole made through bombardment of the wall. It is also known that Sadiq had sprinkled water in the basement where the ammunition was stored, making the ammunition unusable.
This war brought down the curtains on the all four Mysore Wars. The British acquired indirect control of Mysore, reestablishing the Wodeyar dynasty to the Mysore throne. Tipu's young heir, Fateh Ali, was sent into exile. The Kingdom of Mysore became a princely state of British India and relinquished Coimbatore, North Kanara and Souht Kanara to the British.