Courten served in the Spanish–Portuguese War of 1761 to 1763. He was promoted to captain on 14 May 1768. In 1775 Courten took part in the Invasion of Algiers, a humiliating defeat of the Spanish army at the hands of the Moors. Because of public anger at the disaster, the officers who were involved were disgraced and posted far from the royal court. Officers whose reputations suffered in the debacle were Alejandro O'Reilly, Antonio Ricardos, Luis Firmín de Carvajal, Conde de la Unión, Jerónimo Girón-Moctezuma, Marquis de las Amarillas, Domingo Izquierdo, Pedro Caro, 3rd Marquis of la Romana, and Ventura Caro. These men banded together in a secret society within the military to push for modernization. Courten was a member of this group.