Aside from the various slave uprisings and insurrections that began in the early 1800's, there were two major wars and one "little war."
The first major war is the Ten Year War (1868-1878) from which Antonio Maceo and others emerged. The end of this effort was "negotiated" by Spanish Captain General Martinez Campos, and many of the rebels were forced into exile.
Two years later another effort (known as "the little war") was organized by Calixto Garcia and others, but it was defeated before Maceo, Gomez and other veterans of the Ten Year War could arrive. Antonio Maceo's younger brothers (Jose and Rafael) were sent to a prison in Africa, where Rafael died. Jose was later able to escape.
The war of independence, which finally separated Cuba from Spain, began in February 1895. Martí, who formed the Cuban Revolutionary Party and arranged for the return of Maceo, Gómez and others from the two previous wars, organized the effort and died in battle.
But victory over Spain was bittersweet, as it left Cuba in the hands of the US government.