Céspedes was deposed in 1873 in a leadership coup. Spanish troops killed him in February 1874 in a mountain refuge, as the new Cuban government would not let him go into exile and denied him an escort. The war ended in 1878 with the Pact of Zanjón, which made concessions: liberation of all slaves and Chinese who had fought with the rebels and no action for political offenses but no freedom for all slaves and no independence. The "Grito de Yara" had not achieved enough, but it had lit a long-burning fuse. Lessons learned in it would be put to good use during the Cuban War of Independence.