Colombia and Venezuela have agreed to restore diplomatic dialogue and oversee the "progressive normalisation" of their border.
It follows a meeting between Colombian President Juan Manuel Santos and his counterpart Nicolas Maduro.
The two countries have been locked in a border conflict for a month, after Maduro ordered the closure of part of the frontier, saying some of his military were attacked during an anti-smuggling operation by Colombian paramilitaries.
Ecuadoran President Rafael Correa, who hosted the talks in Quito, made the announcement in a joint statement that said Santos and Maduro had authorised the "immediate return of their respective ambassadors".
It was the first meeting between Maduro and Santos since the crisis erupted on August 19.
Maduro had also accused Colombia of waging an "attack on Venezuela's economy", a reference to the rampant smuggling of heavily subsidised goods out of the oil-rich but shortage-hit socialist country.
The row also saw tens of thousands of Colombians deported or flee Venezuela, prompting Bogota to accuse Caracas of violating its citizens' rights.