Upon the deportation of Rizal, many Filipino nationalists established the Katipunan, another secret society, but this time with the aim of gaining independence from Spain through a revolution. Inspired by Rizal's works, the Katipunan organized an armed resistance to Spanish rule, led by Andrés Bonifacio. After the activities of the Katipun were discovered in August 1896, the Philippine Revolution began. Members of the Katipunan revolted in Caloocan, establishing the Tagalog Republic and declaring a nationwide armed revolution. Rizal, who had no part in the revolution himself, was court-martialed for rebellion, sedition and conspiracy. He was convicted on all charges and executed by firing squad. In 1897, Bonifacio was deposed and executed by Emilio Aguinaldo, who assumed the leadership of the revolutionary movement. After driving the Spanish out of the archipelago, Aguinaldo subsequently established a dictatorship and declared independence. However, the treaty of Paris officially ceded the Philippines to the United States, which ignited an armed conflict with the newly established First Philippine Republic.