importation and use of African slaves. In 1517, the Spanish Crown permitted its subjects to import twelve slaves each, thereby beginning the slave trade on the colonies. African slaves were legally branded with a hot iron on the forehead, prevented their "theft" or lawsuits that challenged their captivity. The colonists continued this branding practice for more than 250 years. They were sent to work in the gold mines, or in the island's ginger and sugar fields. They were allowed to live with their families in a hut on the master's land, and given a patch of land where they could farm, but otherwise were subjected to harsh treatment; including sexual abuse as the majority of colonists had arrived without women; many of them intermarried with the Africans or Taínos. Their mixed-race descendants formed the first generations of the early Puerto Rican population. The slaves faced heavy discrimination and had no opportunity for advancement, though they were educated by their masters. The Spaniards considered the Africans superior to the Taíno, since the latter were unwilling to assimilate. The slaves, in contrast, had little choice but to adapt. Many converted to Christianity and were given their masters' surnames. By 1570, the colonists found that the gold mines were depleted, relegating the island to a garrison for passing ships. The cultivation of crops such as tobacco, cotton, cocoa, and ginger became the cornerstone of the economy. With rising demand for sugar on the international market, major planters increased their labour-intensive cultivation and processing of sugar cane. Sugar plantations supplanted mining as Puerto Rico's main industry and kept demand high for African slavery. After 1784, Spain provided five ways by which slaves could obtain freedom. Five years later, the Spanish Crown issued the "Royal Decree of Graces of 1789", which set new rules related to the slave trade and added restrictions to the granting of freedman status. The decree granted its subjects the right to purchase slaves and to participate in the flourishing slave trade in the Caribbean. Later that year a new slave code, also known as El Código Negro (The Black Code), was introduced. Under "El Código Negro", a slave could buy his freedom, in the event that his master was willing to sell, by paying the price sought in installments. Slaves were allowed to earn money during their spare time by working as shoemakers, cleaning clothes, or selling the produce they