A UN conference overcame nine days' wrangling over the Middle East and African demands for reparations for slavery to seal an agreement on fighting racism wherever it can be found.
The Durban declaration came a day after the conference was due to close, and bad feelings lingered, but exhausted delegates from some 160 countries finally hammered out a text laying down measures to combat racism and xenophobia.
"Many questioned whether it would be possible to reach consensus but we have achieved it," said United Nations High Commissioner for Human Rights Mary Robinson, who was secretary-general of the conference, the largest ever on racism.
UN Secretary-General Kofi Annan welcomed the accord but said he regretted the event was overshadowed by disagreements.
"Clearly we all need to reflect on this experience and see what we can learn from it," he said in a statement in New York.
"Not all problems in the world can be resolved at United Nations Conferences. And when Member States do decide to hold such conferences we need to be conscious that, on some issues, they will reflect areas of real disagreement dividing the international community," Mr Annan said.
"It is regrettable that the useful work of the conference was overshadowed by disagreements on one or two highly emotional issues, especially the Middle East. Many hurtful things were said ... which tended to inflame the atmosphere rather than to encourage rational and constructive discussion."
In the end, the conference expressed concern about the plight of the Palestinian people under foreign occupation but did not brand Israel racist.
Several countries, including Canada, Syria, Australia and Iran, expressed deep reservations over the wording on the Middle East, although they did so for different reasons.
On slavery, the text acknowledges and profoundly regrets the massive human sufferings and the tragic plight of millions of men, women and children and branded the trade a crime against humanity.
It backed more aid, but did not promise reparations.
The result was a relief for South Africa, which had battled to find common ground over the contentious issues.