The breakthrough came when their foreign ministers signed an accord setting out how the plant and the river would be environmentally monitored.
Argentina argued the mill polluted the river, while Uruguay said strict environmental codes were followed.
The dispute saw frequent protests on the Argentine side and strained ties.
"I'm very happy with the accord," Uruguayan President Jose Mujica said, while Argentine Foreign Minister Hector Timerman used similar language, tweeting that "both governments are very satisfied".
Mr Timerman and his Uruguayan counterpart, Luis Almagro, signed an accord late on Sunday, finessing an earlier agreement reached by the two countries in July.
The accord sets up a scientific committee composed of experts from both nations which will monitor the pollution levels in the River Uruguay and within the mill.
The pulp mill, which opened in 2007, is located in the Uruguayan town of Fray Bentos on the banks of the River Uruguay which forms the border between the two South American nations.
Residents across the river in the Argentine town of Gualeguaychu staged frequent protests and closed the bridge that spans the river, arguing that the plant was contaminating the water.
People there say they will await the results of the first monitoring tests to decide if they will resume their actions, BBC Mundo's Veronica Smink reports.
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 a ruling issued in April, the ICJ said that Uruguay had breached its procedural obligations to inform Argentina of its plans but had not violated its environmental obligations under the treaty and therefore the mill could continue operations.
Argentina and Uruguay both say they are happy after a deal was reached to end their long-running row over a pulp mill on the banks of their shared river.