In 1766, 12,000 Mysore forces under Hyder Ali marched to Malabar from Mangalore. Mysore's intentions were made easy by the help they received from the Muslims in Malabar. Ali Raja of Kannur, a Muslim ruler in northern Kerala, also helped the invading forces. The Mysore army conquered northern Kerala up to Kochi with relative ease. Hyder Ali inflicted a major setback on the Kozhikode warriors at Perinkolam Ferry on the Kotta River. As Mysore edged closer to the outer reaches of the city of Kozhikode, the Samoothiri sent most of his relatives to safe haven in Ponnani, and from there to Travancore, and to avoid the humiliation of surrender committed self-immolation by setting fire to his palace at Mananchira (27 April). Hyder Ali absorbed Malabar district to his state.