 During the Spanish–American War, he was in charge of defense of Guamaní, a peak that commanded the road between Cayey and Guayama.He was thus involved in the Battle of Guamaní (August 9, 1898), and was responsible for repulsing an attack by American troops there.After the war, he gained notoriety as the author of a pamphlet called "La defensa de Puerto Rico", which supported Governor General Manuel Macías y Casado, who had become head of the government of Puerto Rico under the Autonomous Charter created in February 1898 (Puerto Rico soon passed under American control).