For years Ecuador and New Granada (Colombia) hotly disputed their common border, each wanting more territory. In 1861, conservative Gabriel Garcia Moreno (1821-75) became Ecuadoran president and soon attempted to unify his country, which was sharply divided by class, regional, and language differences, by handing over much power to the Roman Catholic Church, which he considered the people's chief social tie to achieving a sense of nationalism. Many Ecuadorans opposed his autocratic regime, which gave control of education and welfare to clerics and suppressed leading liberal president, Tomas Cipriano de Mosquera (1798-1878), backed rebellious Ecuadorans in an effort to topple Garcia Moreno, who responded by sending a 6,000-man army under his elderly father-in-law, General Juan Jose Flores (1800-1864), to invade New Granada. On December 6, 1863, at the Battle of Cuaspad, some 4,000 Colombians under Mosquera utterly defeated the invaders, about 1,500 of whom were slain or wounded and 2,000 taken captive. The war ceased, and differences were settled by a treaty.