Complex sentence: When the island was returned to the Spanish, colonial official Julian de Arriaga realized that slaves could become partisans of the enemies who would offer them freedom, and as such, they gave "cartas de libertad" to the two dozen slaves who had defended Havana.
Split into simpler sentences: When the island was returned to the Spanish, colonial official Julian de Arriaga realized that slaves could become partisans of the enemies who would offer them freedom. The Spanish gave "cartas de libertad" and emancipated some two dozen slaves who had defended Havana.