On 10 January 1917, U. S. marines were invading the port city, and Gilbert decided to fight against them, he charged a revolver and shot against the marines, killing officer C. H. Burton in the firefight. He joined the guerrilla against the United States occupation; he was captured and sentenced to death. His sentence was commuted to life imprisonment, but he was released on 22 October 1922; Gilbert went to the exile in Cuba, Curaçao, and Nicaragua. In Nicaragua, he joined Sandino’s rebellion against the United States occupation of that country.