 By the late 17th @-@ century , the rajas of Coorg had created an " aggressive and independent " state , which became known for its acts of " wanton cruelty " against enemies , and for its " system of terror " directed at its citizens . Muddu Raja , the Coorg ruler from 1633 to 1687 , initially ruled from the town of Haleri , but later moved his capital to Mercara , which he fortified and where he built a palace in 1681 . Early during the rule of his successor , Dodda Virappa ( 1687 – 1736 ) , the army of the neighboring kingdom of Mysore , under the orders of Wodeyar Chikka Devaraja , attacked and seized Piriyapatna , a territory which abutted Coorg ( see Map 11 ) , and which was then being ruled by a kinsman of Dodda Virappa . Buoyed by the victory , the Mysore army soon attacked Coorg itself ; however , it had advanced only a short distance , when , while camping overnight on the plain of Palupare , it was surprised by a Coorg ambush . In the ensuing massacre , the Mysore army lost 15 @,@ 000 men , and the survivors had to beat a hasty retreat . For most of the next two decades , the western reaches of Mysore remained vulnerable to attacks by the Coorg army . In the border district of Yelusavira , the Coorg and Mysore forces fought to a stalemate and , in the end , had to work out a tax sharing arrangement . 
