Little is known of De Leyba's life until his appointment to the position of governor on June 14, 1778. Immediately upon his appointment to the post, he was ordered by Bernardo de Galvez to keep abreast of events occurring in the American Revolutionary War, and to keep any correspondence with an American chief secret and report it at once to Galvez. De Leyba met George Rogers Clark barely two months later, when Clark, fresh from his victory at Kaskaskia, visited St. Louis and met with the governor. Fearing an attack from Detroit, Clark suggested that De Leyba fortifythe town; upon being notified of this, Galvez responded that De Leyba would have to make do on his own, as no fortifications would be provided. War was declared between Spain and Great Britain in June 1779, and attack was launched on St. Louis the next year. Given fair warning, De Leyba managed to raise 1000 piastres, including 400 of his own money, for the construction of Fort San Carlos. Already deep in debt from his gifts to the Indians, the governor could ill afford paying for the entire fort on his own. In any event, only one tower was completed, with part of a second also built. This was enough to repel the British attack, which came on May 26. After their failure, the invaders laid waste to the surrounding farms as part of their retreat. De Leyba's health was already poor, and, by June 28, he was dead. His report of the action reached Galvez only after his death, yet the general was impressed enough to promote the governor, posthumously, to the rank of lieutenant colonel. After De Leyba's death, many of the villagers from the area around St. Louis began to blame him for their troubles, writing anonymous letters to the government in New Orleans detailing his supposed misbehaviors. Some people began calling him a "Spanish Benedict Arnold". In 1831, one historian Judge Wilson Primm wrote a lecture in which he stated that the governor had not only sold the gunpowder stores to the enemy, he had acted in a cowardly manner during the engagement and deliberately impeded the defense of the village. Supported by accounts made by survivors some fifty years after the battle, these accusations were accepted by many historians for much of the nineteenth century, and it is only recently that some have begun to reconsider the role De Leyba played in the defense of the American frontier.