Colombia has announced it no longer recognises the jurisdiction of the International Court of Justice, in The Hague.
The decision comes nine days after the ICJ redrew Colombia's maritime border in the Caribbean in favour of Nicaragua.
The court's ruling ended a decades-long dispute over the San Andres islands.
President Juan Manuel Santos said individual countries, and not courts of law, should fix their borders.
The ICJ ruled that the islands and a group of islets near the Nicaraguan coast in the western Caribbean belonged to Colombia.
But it set up new maritime borders in the potentially oil-rich area, extending Nicaragua's territory by some 70,000 square km (19,000 square miles).
The judgment, which is binding, was welcomed by Nicaragua but greeted with anger by President Santos.
Mr Santos has now announced that Colombia is pulling out of the Bogota Treaty, signed in 1948, that recognises the court's rulings.
"The borders between nations cannot be in the hands of a court of law," he said. "They must be drawn by agreement between the countries involved."
Mr Santos reaffirmed he would only be using "peaceful means" to solve dispute.
The competing claims date from the early 19th Century, when the nations of Latin America were gaining their independence from Spain.
Nicaragua and Colombia signed a treaty in 1928 to settle the border and sovereignty of islands in the Caribbean.
But in 1980, Nicaragua's Sandinista government unilaterally annulled the agreement, arguing that it had been signed under US pressure.
In 2007, the ICJ ruled that the treaty was valid and that the sovereignty of three islands, San Andres, Providencia and Santa Catalina, remained with Colombia.
The archipelago lies some 775km (480 miles) from the Colombian coast and 230km from Nicaragua.
- 20 November 2012
- 31 May 2018
- 8 August 2018