Regional foreign ministers have agreed a resolution aimed at settling the crisis sparked by a deadly Colombian raid on a Farc rebel camp in Ecuador.
Colombia's raid on the Farc camp inside Ecuador raised tensions
Organization of American States (OAS) ministers deplored the incursion.
But the US voiced reservations, saying Colombia had acted in legitimate self-defence in attacking the rebels.
The OAS intervened to calm anger after Ecuador and Venezuela cut diplomatic ties with Bogota and sent troops to their borders with Colombia.
After hearing a report from an OAS delegation that had visited the site of the incursion and following hours of talks, the foreign ministers finally agreed on a resolution.
The text deplored the "incursion of Colombian armed forces and police into Ecuadorean territory" on 1 March.
Art 19: No State or group of States has the right to intervene, directly or indirectly, for any reason whatever, in the internal or external affairs of any other State. The foregoing principle prohibits not only armed force but also any other form of interference or attempted threat against the personality of the State or against its political, economic, and cultural elements.
Art 21: The territory of a State is inviolable; it may not be the object, even temporarily, of military occupation or of other measures of force taken by another State, directly or indirectly, on any grounds whatever. No territorial acquisitions or special advantages obtained either by force or by other means of coercion shall be recognised.
The action was taken "without the knowledge or approval of the Ecuadorean government, which constitutes a clear violation of articles 19 and 21 of the OAS charter".
The resolution also referred to Colombia's "clear apology" for its incursion.
It also reiterated the commitment of all countries to tackle " the threat to security arising from irregular groups or criminal organisations, in particular those connected to drug trafficking".
Ecuador's foreign minister, Maria Isabel Salvador, said it was a "clear victory" for her country's stance.
She said that Ecuador would now evaluate the restoration of diplomatic ties with Colombia.
"We achieved our aim of getting co-operation in the fight against criminals, insurgents and terrorists," said Colombian Foreign Minister Fernando Araujo.
Colombia's military had followed up an air-strike on the camp with an attack by ground forces that killed Farc's second-in-command Raul Reyes and more than 20 others.
OAS delegates from Peru, Brazil and Argentina visited the site
The cross-border raid on the camp in Angostura, some 250km (155 miles) north-east of Quito, sparked the region's worst diplomatic row for years.
Tensions were subsequently eased at a summit in the Dominican Republic after which Venezuela restored its relations with Colombia.
Ecuador has proposed that an OAS force or UN troops be deployed to monitor its border with Colombia.
Colombian President Alvaro Uribe has indicated he would not rule out such a proposal.
But OAS Secretary General Jose Manuel Insulza said that he did not believe such an idea was viable.
The Colombian government has said it regrets conducting the cross-border raid but that it was necessary "in the fight against terrorism".
Farc - the Revolutionary Armed Forces of Colombia - has been fighting the Colombian state for more than four decades, and is viewed by the US and the EU as a terrorist group.