In the 1820s, when the rest of Spain's empire in Latin America rebelled and formed independent states, Cuba remained loyal to Spain. Its economy was based on serving the empire. By 1860, Cuba had 213,167 free people of color (39% of its non-white population of 550,000).