Updated

Costa Rica accused Nicaragua on Tuesday of flagrantly breaching international law by putting troops on disputed land along the river that forms the two nations' border and asked the highest U.N. court to order their immediate withdrawal.

San Jose has accused Nicaraguan troops of illegally setting up camp on its territory in October as part of a dredging project to create a canal. Nicaragua denies violating Costa Rican territory.

The dispute even drew in Google when the Nicaraguan official in charge of the dredging project said in a newspaper interview that he used Google's map system to decide where the work should be done.

Costa Rican Foreign Ministry legal adviser Sergio Ugalde told the court that Google quickly fixed an inaccurate map cited by Managua.

"Alerted to the mistake, and despite Nicaraguan protests, Google acknowledged the error and amended their map on Google Earth," Ugalde told the court.

The San Juan river has been a source of disputes for nearly two centuries.

In 2009, the International Court of Justice set travel rules for the river, affirming freedom for Costa Rican craft to navigate the waterway while upholding Nicaragua's right to regulate traffic.

Costa Rica's agent to the court, Edgar Ugalde, told the 16-judge panel the dispute is threatening "the peaceful coexistence of the region."

"This is not the way two states who see each other as brothers should treat each other," he said as hearings started at the world court's oak-panelled Great Hall of Justice in The Hague.

Ugalde called Nicaragua's actions "a flagrant breach of law" and said his country, which has no army, has no way of "facing up to military incursions."

Costa Rica has asked the court to issue an emergency order for Nicaragua to immediately withdraw its troops and halt dredging.

Nicaraguan lawyers were to address the court later Tuesday. They argue the dredging work is being carried out on Nicaraguan territory.