Since the early decades after independence, Chile has always had an active involvement in foreign affairs. In 1837, the country aggressively challenged the dominance of Peru's port of Callao for preeminence in the Pacific trade routes, defeating the short-lived alliance between Peru and Bolivia, the Peru-Bolivian Confederation (1836–39) in the War of the Confederation. The war dissolved the confederation while distributing power in the Pacific. A second international war, the War of the Pacific (1879–83), further increased Chile's regional role, while adding considerably to its territory.