ON JANUARY 27th the International Court of Justice (ICJ) gave its ruling in a case brought in 2008 by Peru, which claimed around 38,000 sq km of the Pacific Ocean from Chile. In the run-up to the verdict, both Peruvians and Chileans were transfixed by the issue. In a judgment that seemed arbitrary but broadly fair, the court allowed both sides to claim victory.

The dispute goes back to the War of the Pacific (1879-1883), a conflict over control of the nitrate industry in the Atacama desert, in which Chile defeated Peru and Bolivia, annexing Bolivia’s coastal province of Antafogasta and the Peruvian provinces of Tacna, Arica and Tarapacá. Chile was supposed to organise a plebiscite after ten years in which the populations of Tacna and Arica would decide which country they wanted to belong to. It failed to do this; American mediation in 1929 awarded Tacna to Peru and Arica to Chile and fixed the land boundary between the two countries. In the 1980s Peru’s diplomats began to argue that whereas the land border was settled, the maritime boundary wasn’t. Under the Santiago Declaration of 1952 Chile, Ecuador and Peru agreed notional maritime boundaries of 200 miles, aimed mainly at scaring off outsiders, such as Aristotle Onassis’s whaling fleet. The de facto boundary ran due west from the land border. Since the coast forms an elbow at the border, swinging north-west in Peru, this boundary was in Chile’s favour. Peru asked the court for three things: to fix a new boundary running equidistant between the two countries’ coasts; that the boundary should start at Punta Concordia, where the land border hits the sea, and not at Border Marker No 1 (Hito 1), 250 metres to the north; and to confirm as Peruvian an “external triangle” of 29,000 sq km lying more than 200 miles west of Chile, but less than 200 miles from Peru’s coast.

The ICJ accepted Chile’s argument that the Santiago Declaration and subsequent conventions amounted to an agreement on the maritime boundary—but only for the first 80 nautical miles. (It also accepted that the boundary starts in line with Hito 1, as Chile claimed.) Thereafter, it accepted Peru’s claim, and drew a new boundary running broadly south-westward. Chile hung on to its inshore waters, which contain most of the fish in the disputed area. But Peru has won about 21,000 sq km of the disputed 38,000 sq km, plus the external triangle. Some Peruvians were disappointed that the ICJ didn’t accept their claim in full. But the country’s main gain is a symbolic one: for the first time it has won a battle with Chile, and it has done so by peaceful, legal means and through professional diplomacy. The fact that the judgment was less bad than many Chileans feared should in turn make it easier for Chile’s government to implement the new boundary quickly.

The court left the two countries to fix the exact boundaries. Peru worries that on past form Chile will drag its feet in implementing the ruling. But Chile insists it will do so. Both countries should now move on. Peruvians have long considered Chileans to be abusive and arrogant, while Chileans have seen Peruvians as perpetual whingers. With luck, relations between the two countries, which have already improved in the past two decades, should get better still. Peru and Chile are partners in the Pacific Alliance, a block of free-trading Latin American countries; trade and investment between them has increased. “The end of the dispute” said Peru’s president, Ollanta Humala, will “allow us to begin a new stage in our relations with Chile”, of co-operation and friendship. Finally getting over the legacy of a 19th-century war would be a prize for both countries.