The sum was well below the $6.7 million demanded by Costa Rica for the environmental harm done to the area, and to compensate its efforts to restore it.

World Bulletin / News Desk

The UN's highest court on Friday ordered Nicaragua to pay less than $380,000 to Costa Rica in compensation for damaging protected wetlands on the river San Juan.

"The court concludes that the total amount of compensation to be awarded to Costa Rica is $378,890.59," judge Abdulqawi Ahmed Yusuf told the International Court of Justice (ICJ).

Managua has until April 2 to pay the amount, after which it will incur a higher rate of interest, judge Yusuf warned at the court in The Hague, in what was its first ever ruling for environmental damage.

The dispute centres on a tract of land known in Costa Rica as Isla Portillos and in Nicaragua as Harbour Head -- a biological preserve lying in a border area long disputed by both Central American nations.

The compensation ruling came more than two years after the ICJ found that Costa Rica had sovereignty over the area, basing its ruling in part on an 1858 treaty between the two countries.

The ICJ said Nicaragua had violated its neighbour's territory in 2010 by sending a small military contingent to set up an outpost there.

It also undertook dredging in the San Juan river and excavated three canals in the sensitive wetlands area.

In December 2015, the court reproached Managua for violating San Jose's right to navigation in the waters and ordered the two countries to negotiate an amount of compensation.

But the neighbours failed to reach a deal, so the issue trundled back to the ICJ so judges could set the compensation amount.

The case is one of several disputes between the two countries which have ping-ponged back and forth in the UN's highest court, set up in 1945 to rule on border and territorial disputes between nations.

Judges later Friday were also to rule on two further border disputes between the Central American neighbours.

Costa Rica wants the ICJ to set its maritime boundaries on both its western Pacific Ocean coast and the Caribbean Sea to the east.

The two countries first held negotiations in 1976 to try to reach an agreement on the border which broadly follows the San Juan river, but talks have dragged on.

The case was first lodged with the ICJ in 2014, when Costa Rica maintained it had "exhausted its diplomatic means" to resolve the row.