 He was appointed by Charles II of Spain governor of the Cape of Cagliari and Gallura and military governor of Sardinia.During the war of the Spanish succession, when Sardinian aristocracy divided between Philip of Anjou (of the house of Bourbon) and Charles of Habsburg, Bacallar was loyal to the heir designated by Carles II, Philip of Anjou, who became king as Philip V. Due to his loyalty, the king awarded him as Marquess of San Felipe (Marqués de San Felipe, in Spanish; not a feudal title, but given in homage to the king's patron saint) and Viscount of Fuentehermosa (Fuente Hermosa de Miranda, fief in the kingdom of Navarre) in 1709.When the kingdom of Sardinia surrendered to Archduke Charles, he had to fly to Spain, without giving up the hope to re-conquer Sardinia.