San Juan River dispute: Both sides told to stay away
The UN's highest court has ordered both Nicaragua and Costa Rica to keep all personnel back from a disputed border.
In November, Costa Rica complained to the International Court of Justice that Nicaragua had illegally sent troops and engineers into its territory to dredge part of the San Juan River.
In ordering Nicaragua to keep its troops out, the court ruled partly in favour of Costa Rica.
But it did not accept that the dredging was damaging the environment.
Both Costa Rica and Nicaragua lay claim to the Portillos Islands in the San Juan River, which forms the border between them.
The court, in The Hague, ruled that both countries must keep all military, police and civilian personnel out of the region.
However, Costa Rica can send civilian staff to monitor any potential damage to the environment.
The court told both countries to "refrain from any actions which might aggravate or extend the dispute".
Both sides welcomed the ruling.
Costa Rican Foreign Minister Rene Castro said the ruling had stopped an "aggressive invasion" by Nicaragua and was an "important step" towards the resumption of dialogue between the two countries.
"The important thing for Nicaragua was the dredging and that has not been stopped," said Carlos Arguello-Gomez, Nicaragua's ambassador to The Netherlands.
"We had already told the court the troops were out and that the small cleaning of the channel was over," he was quoted as saying by Reuters.