Uruguay should have informed Argentina about its plans to build two paper mills on the banks of a river they share, the UN's top court has ruled.
But the International Court of Justice in The Hague said Uruguay had not violated its environmental obligations and the mill can continue working.
Only one mill was built but the dispute has simmered for several years.
Argentina argues the mill is polluting the river, while Uruguay says it adheres to strict environmental codes.
Argentina lodged a complaint before the International Court of Justice (ICJ) in 2006, arguing that Uruguay had broken the terms of a 1975 treaty regulating the use of the River Uruguay which forms the border between them.
In its ruling, the ICJ said that Uruguay had breached its procedural obligations to inform Argentina of its plans.
However, the court said Uruguay had not violated its environmental obligations under the treaty.
Argentina's view that the plant was causing noise and visual pollution and producing "bad odours" did not fall within the cour'ts jurisdiction, the ruling said.
The court rejected Argentina's request for the mill, located on the Uruguayan bank of the river near the town of Fray Bentos and built by the Finnish firm Botnia, to cease operations.
It also turned down a request for compensation for "alleged injuries suffered in various economic sectors, specifically tourism and agriculture".
The dispute over plans to build intially two and then just one paper mill brought Argentine protesters onto the streets.
Rresidents of the Argentine town of Gualeguaychu across the river from the plant blockaded roads and river crossings, and at times relations between the two South American nations were strained.
The ICJ's rulings are final and cannot be appealed against.