Delegates at the United Nations World Conference Against Racism in Durban, South Africa, have broken an impasse over how to refer to slavery and colonialism, paving the way for agreement on a global plan to combat racism.
Disputes over the Middle East and demands that western governments apologise for colonial-era slave trading have dogged the conference since it began on August 31.
Despite the last-minute compromise deal, which has yet to be signed by delegates at a final plenary session, Switzerland said it regretted the polarisation of the historical gathering.
"We are sorry that this conference was polarised around some political issues from the outset. But Switzerland stayed in Durban to achieve a substantial result," Peter Maurer, deputy head of the Swiss delegation at the South Africa conference, told swissinfo.
The week-long conference was the largest international gathering on racism ever held, but was beset by bickering even before it opened.
South Africa sought desperately to broker an agreement on a final resolution, which included a reference to the Palestinians' right to statehood, but removed any suggestion that Israel was "racist".
Arab states' demands
Arab states had sought to have Israel branded as a racist state, and to equate Zionism - the ideology of Israel - with racism. But the US president, George W Bush, condemned the draft text for "singling Israel out", and withdrew the low-level American delegation from the conference on Monday.
Israel followed suit shortly afterwards.
As haggling continued in the final hours of the conference, a breathrough was achieved. Muslim states said they would not block the compromise text, although it fell short of demands for a condemnation of Israel.
The text recognises the "plight of the Palestinian people under foreign occupation" but included a statement that said all states, including Israel, had a right to security.
Slave trade reparations
The other issue dogging the conference was African countries' demands that the slave trade should be labelled a "crime against humanity" and countries where slaves were seized be paid reparations, as Jews were for the crimes of the Nazis.
The European Union blocked the inclusion of these demands in a final resolution, but at the last minute agreed to apologise for slavery and colonialism.
Despite the divisions, the UN High Commissioner for Human Rights, Mary Robinson, said it was a great achievement to get an agreement at all.
Switzerland, which has one of the largest foreign populations in Europe, hailed the conference as a step forward in the fight against discrimination.
"It was a learning experience to foster a better understanding of race as a political concept and we hope that victims are allowed to define what constitutes racism," said Swiss delegate, Muriel Beck Kadima.
swissinfo with agencies