trade. Nicoya traded with the city of Espíritu Santo de Esparza and Puntarenas. The increase in trade led to the growth of new settlements, such as the one that led to the establishment of the town of Guanacaste in 1768, and the concentration of ladinos in the area of Diriá in 1814, which gave rise to the town of Santa Cruz. Nicaragua also had pretensions about the territory, particularly because of the existence of large cattle ranches in the northern region, which were owned by Nicaraguan landowners settled in Rivas. However, the authorization of the port of Puntarenas in 1814 made Nicoya and Santa Cruz grow economically. At the beginning of the 19th century an active commercial exchange between the Tempisque region and the valleys of Bagaces and Cañas was consolidated, forming an economic unit with the city of Esparza, which in turn traded with San José in the Central Valley of Costa Rica. In 1809, the colonial authorities detached tobacco production from the Bagaces and Cañas valleys of the Factory in Granada (Nicaragua) and joined it to the San José tobacco factory, allowing the development of the Josefina economy. As the trade in the Tempisque River area increased, the farmers who had farms on both banks of the river had to face a series of administrative obstacles because the territory belonged to two different units. The fluvial route through the Gulf of Nicoya became for the inhabitants of the party an option of transport and commerce more accessible than the terrestrial one, diminishing the dependency of the party of the Nicaraguan populations, and increasing the affinity with Puntarenas. The activity of this port was making feel little by little its economic magnetism over the whole area of the gulf, as a center of demand for agricultural and livestock products, for its trade with the Central Valley and as a contact point to move between the different provinces and viceroyalties of the Spanish Empire, due to the constant arrival of ships from all over the continent. Among the background that led to the annexation, ethnic and socioeconomic factors have also been mentioned. The poorer populations of Santa Cruz and Nicoya were more identified with each other than with the village of Guanacaste, since Nicoya was a city populated mostly by indigenous people and Santa Cruz was inhabited by ladinos, while the inhabitants of Guanacaste were descendants of Spaniards and large