The United Nations' top court on Thursday ordered the Colombian navy to stop interfering in Nicaraguan waters, ruling on a longstanding legal battle over maritime borders.

The International Court of Justice "finds that by interfering with fishing and marine research activities of Nicaraguan-flagged vessels... in Nicaragua's exclusive economic zone... Colombia has violated Nicaragua's sovereign rights and jurisdiction," presiding judge Joan Donoghue said.

The court "finds by nine votes to six... that the Republic of Colombia must immediately cease (this) conduct", she said, handing down the verdict at the ICJ's headquarters in The Hague.

In 2012 the ICJ, which rules in disputes between countries, awarded Nicaragua a swathe of disputed Caribbean Sea territory extending 200 nautical miles from its coastline.

But the following year, Nicaragua lodged a fresh case, accusing Colombia of ignoring the ruling.

It alleged Bogota had threatened to use force to back up its claims in the oil- and fish-rich region.

Nicaragua's lawyers also asked the ICJ to make Colombia pay compensation for "the threat or use of force by the Colombian navy against Nicaraguan fishing boats".

Colombia denied the accusations, saying its presence in the region was "due to other imperatives", including international maritime rescue and the fight against drug trafficking.

Nicaragua-Colombia maritime borders
Nicaragua-Colombia maritime borders AFP / Nicolas RAMALLO

The Nicaraguan government welcomed the verdict, saying it confirmed that Colombia implemented a policy that "violated the jurisdiction and sovereign rights" of Nicaragua.

Speaking outside court after the judgement, Colombia's representative, Carlos Gustavo Arrieta Padilla, said he still believed "the ruling is mainly in favor of Colombia".

The judges "did not ask us to cease our presence in Nicaraguan waters... They never ordered us to leave... the area," Arrieta said.

"The court has maintained the possibility of the Colombian navy being there and doing operations in the fight against organised crime in the area," he said.

Colombian President Ivan Duque said his navy retained its "fundamental" ability to navigate in the area but did not mention if he would accept the ICC ruling relating to Bogota's interference.

In an evening address to the nation, Nicaraguan President Daniel Ortega said the ICC's ruling was "clear and irrefutable", and expressed confidence that Duque would "not go on to violate Nicaraguan rights recognized by the court since 2012."

He addressed Colombian authorities directly, saying: "We demand you abide by the ruling, that you take a step toward respecting international law and peace."

Relations between Nicaragua and Colombia have been strained for almost a century over disputed maritime borders
Relations between Nicaragua and Colombia have been strained for almost a century over disputed maritime borders AFP / DANIEL MUNOZ

In a game of legal ping-pong, Bogota accused Managua of interfering with indigenous fishing rights.

The loss of fishing grounds because of the ICJ's 2012 ruling particularly affected the Raizal people, an English- and Creole-speaking community who are mainly descendants of slaves taken from Africa, Colombia's lawyers said.

However, Donoghue said Colombia "failed to establish that the inhabitants of the San Andres archipelago, in particular the Raizales, enjoy fishing rights in waters now within Nicaragua's exclusive economic zone".

The court nonetheless "noted Nicaragua's willingness... to negotiate with Colombia an agreement regarding access by members of the Raizales community to fisheries within Nicaragua's exclusive economic zone".

The best way to do this was through a bilateral agreement, Donoghue said.

The judges rejected Nicaragua's claim for compensation.

Although there are no land borders between Nicaragua, located in Central America, and Colombia, in South America, diplomatic relations have been strained for almost a century over disputed maritime limits.

Nicaragua finally took Colombia to the ICJ in 2001, and in 2012 it won several thousand square kilometres (miles) of territory in the southwestern Caribbean that had previously been Colombian.

Colombia, which was left with only seven islets, said at the time it would no longer recognise the court's jurisdiction on border disputes.

Nicaragua then went back to the court in 2013, alleging violations of the judgement by Colombia.

Judges at the ICJ ruled in 2016 that they had jurisdiction in the dispute, brushing aside Colombian objections that the court was not competent to hear the cases.

Countries are obliged to implement judgements by the Hague-based ICJ, which are final and cannot be appealed.

In rare situations where a country refuses, the matter can be referred to the UN Security Council by the complainant country for further action.