In 1869 he published his first political writings in the only edition of the newspaper El Diablo Cojuelo. That same year he published "Abdala," a patriotic drama in verse form in the one-volume La Patria Libre. His famous sonnet "10 de octubre" was also written during that year, which was published later in his school newspaper.

Despite this success, in March of that year, colonial authorities shut down the school, interrupting Mart√≠'s studies. He came to resent Spanish rule of his homeland at a young age; likewise, he developed a hatred of slavery, which was still practiced in Cuba.

In October 1869, he was arrested, then incarcerated in the national jail following an accusation of treason from the Spanish government. More than four months later, Mart√≠ assumed responsibility of the charges and was condemned to six years in prison. His mother tried arduously to free her son (who was still a minor at the time, at 16 years old) by writing letters to the government; his father went to a lawyer friend for legal support, but all efforts failed. Eventually Mart√≠ fell ill; his legs were severely lacerated due to the chains attached to him. Therefore, he was transferred by the General to another part of Cuba known as Isla de Pinos instead of further imprisonment. Following that, they decided to repatriate him to Spain. In Spain, he studied law and wrote articles on the wrongs of Spanish rule in Cuba.

After spending some time in Spain, Mart√≠ completed his studies, graduated with a bachelor of arts, and obtained his license in civil rights. He then traveled to France, where he spent some time before secretly returning to Cuba under an assumed name in 1877. He was unable to obtain any employment until he accepted a job as a professor of history and literature in Guatemala City.

In 1880, Mart√≠ moved to New York City serving as a joint consul there for Uruguay, Paraguay, and Argentina. He mobilized the Cuban exile community, especially in Tampa and Key West, Florida, to revolution and independence from Spain, while lobbying to oppose U.S. annexation of Cuba, which some American politicians desired.