but which, in practice, operated as a largely autonomous entity within the Spanish Empire. Costa Rica's distance from the capital in Guatemala, its legal prohibition under Spanish law to trade with its southern neighbors in Panama, then part of the Viceroyalty of New Granada and the lack of resources, such as gold and silver, made Costa Rica into a poor, isolated, and sparsely inhabited region within the Spanish Empire. Costa Rica was described as "the poorest and most miserable Spanish colony in all America" by a Spanish governor in 1719.