Trade negotiators hammered out a last-minute compromise on a date for wealthy nations to end farm export subsidies, a support system that poor nations say puts them at a competitive disadvantage.

The breakthrough at the World Trade Organization meeting will likely avert a collapse in talks that could have seriously crippled the organization's ability to promote global free trade.

Outside the meeting, about 1,000 anti-WTO demonstrators marched through downtown Hong Kong, a day after hundreds of protesters were arrested in one of the city's worst spasms of street violence in decades.

The demonstrators chanted "Sink WTO" as trade ministers from around the globe wrapped up six days of negotiations. The protesters claim that the WTO's attempts to open up markets benefit big companies and the rich at the expense of ordinary workers and the poor.

The tentative agreement, coming after all-night negotiations, calls for wealthy countries to eliminate farm export subsidies by 2013. It paves the way for a modest agreement to cut trade barriers across various sectors, according to a copy of the final draft obtained by journalists.

The draft was to be submitted for approval by all 149 WTO member nations and territories later Sunday. Since the WTO is a consensus-based organization, an objection by even one member could torpedo a final deal.

But delegates appeared to be moving toward agreement.

Foreign Minister Celso Amorim of Brazil, which led the developing nations at the meeting, said the draft was "reasonable" and expressed hope it would be adopted by all WTO members.

India's Trade Minister Kamal Nath also welcomed the compromise.

"It is focused and it strikes at various problems of developing countries," he said.

The 2013 date was a key demand of the 25-nation European Union, which held out against intense pressure from Brazil and other developing nations to phase out many of its farm export subsidies by 2010. Developing nations say the government farm payments to promote exports undercut the competitive advantage of poor farmers.

EU trade chief Peter Mandelson said the final draft of WTO agreement is "acceptable."

The revised text also sets April 30, 2006, as a new deadline to work out formulas for cutting farm and industrial tariffs and subsidies — a key step toward forging a sweeping global free trade treaty by the end of next year.

But the draft reflects a far less ambitious agreement than WTO negotiators had originally hoped to achieve in Hong Kong: a detailed outline for a global free trade agreement that the WTO hopes to forge by the end of 2006, concluding the current round of development-oriented trade talks that began in 2001 in Doha, Qatar.

The draft agreement noted "the compelling urgency of seizing the moment and driving the process to a conclusion as rapidly as possible. We must maintain momentum. You don't close divergences by taking time off to have a cup of tea," it said.

"To meet this challenge and achieve this goal, we must act decisively and with real urgency," the text said.

The final draft also calls on wealthy nations to allow duty-free and quota-free privileges to at least 97 percent of products exported by the so-called least developed countries by 2008.

In a victory for West African cotton-producing nations, the text retained an earlier proposal that rich countries eliminate all export subsidies on cotton in 2006.

It also represents a concession by the United States, a major cotton exporter. U.S. Trade Representative Rob Portman had said the proposal would be a hard sell to U.S. lawmakers. Cotton growers in Burkina Faso, Benin, Chad and Mali say the U.S. farm aid drives down prices, making it impossible for small family farms to compete in international markets.

The Group of 20, a coalition of developing nations headed by Brazil and India, said it was prepared to accept the draft's proposals on agricultural trade.

Portman was noncommittal, saying he had concerns about the final draft but hoped to end up with an acceptable version.

"Some members have concerns as we do, but in the end there is an overriding need to come together and work out our differences so I'm hopeful we can do that," Portman said as he headed from his hotel to the convention center after reading the draft.

Meanwhile, Hong Kong security forces braced for more fighting and chaos. Some 900 demonstrators, among them many South Korean farmers, were arrested after they went on a rampage Saturday evening, attacking police with bamboo poles and barricades and trying to break into a building. Police scattered them with tear gas and seized control of the area.

Such large-scale violence is rare in this stable Asian financial capital. The last time the city saw such a melee was during 1967 riots aimed at usurping British colonial rule. Hong Kong was returned to China in 1997.

Sunday's procession was led by Hong Kong activists, who held a giant red banner saying "Oppose WTO." The protesters included Thai and Filipino migrant workers along with Japanese farmers.

Some of marchers were South Korean farmers who carried cardboard signs saying, "Hong Kong government quickly release our comrades!"