The dispute that erupted into war - the four-day Soccer War in 1969 sparked by Honduras losing a World Cup qualifying match to El Salvador - was the most complicated case the court had handled, said the presiding Judge, Jose Sette-Camara, of Brazil.
During the three-hour reading of the ruling, he said the settlement would 'end one of the longest and most complex controversies among Latin American states. With good will, it's going to be an important contribution to bring peace, understanding and progress to a region of the American continent and to its people victimised by suffering due to the scourge of conflicts and disputes.'
Both countries hailed the decision as the definitive end to the border conflict that started just after independence in 1839, and reiterated their promises to abide by the ruling. 'El Salvador has promised to accept,' said Alfredo Martinez Moreno, the country's representative at the court. 'We will do everything possible to respect it.'
The Honduran Foreign Minister, Mario Carias, conceded the new borders would create situations in which some people would be unhappy with where they live. 'But these situations will be resolved according to law and no one need fear any sort of arbitrary act,' Mr Carias said.
At issue were six land segments along the 160-mile border between the two nations, as well as the islands of Meanguera, Meanguerita and El Tigre in the Gulf of Fonseca, and the gulf itself.
Thousands died in the 1969 border war, and the two nations decided to bring the dispute to the International Court of Justice in 1986. Yesterday's ruling gave Honduras roughly two-thirds of 168 square miles of mainland under dispute. Martinez Moreno, the Salvadorean representative, criticised the court for attaching too little significance to documents pertaining to Spanish colonial divisions, which San Salvador had repeatedly invoked to back its claims. 'These are documents of great importance. They are the ones that truly determine the sovereignty of states,' he said.
But Mr Carias defended the ruling, saying the court examined all relevant colonial documents, but 'in many places found they were not sufficient on which to base the border'.
Honduras gained control of the disputed segment at the delta of the Goascoran River, and nearly full control of two other segments, along the Negro-Quiagara and the Sazalapa rivers. El Salvador gained most of the disputed area next to where the two nations' border meets Guatemala's.