Commerce ministers have capped days of hard negotiations by approving a commercial deal that the World Trade Organisation hailed as a historic boost for the trade body and the world economy.
The agreement falls far short of the WTO's lofty but elusive vision of tearing down global trade barriers through its frustrating, 12-year-old Doha round of talks.
But the accord reached at Bali on Saturday nevertheless marks the first global agreement struck by the Geneva-based body since its 1995 founding.
"For the first time in our history, the WTO has truly delivered," an exhausted-looking WTO director-general Roberto Azevedo told a closing ceremony.
The pact includes commitments to facilitate trade by simplifying customs procedures, which some economists have estimated could give a $1 trillion jolt to the world economy.
However, the hard-fought nature of the talks indicated how difficult it could be for the body to make real progress on Doha round issues, analysts said.
The agreement was reached after more than four days of haggling that stretched past the conference's scheduled Friday close and into the early morning hours of Saturday.
Mr Azevedo said it could have important symbolic value for the trade body's hopes of kick-starting Doha. "The decisions we have taken here are an important stepping stone toward the completion of the Doha round," he said.
Mr Azevedo has expressed concern over the rise of alternative regional trading pacts that he fears could render the WTO obsolete if the Geneva-based body did not start hammering out major worldwide agreements.
The Doha round aims to remove hurdles to commerce and establish a globally binding framework of trade rules fair to both rich and poor countries. But protectionist disputes among the WTO's 159 members have foiled agreement.
Failure in Bali "would have dealt a massive blow to the institution's prestige," said Simon Evenett, an international trade expert at Switzerland's St Gallen University.
"But Bali revealed much about how difficult are negotiations between the large trading nations on big-ticket commercial items and there is no sign they are going to get any easier."
The agreement comes as a personal victory for the Brazilian Azevedo, who took the organisation's helm in September and injected a sense of urgency into the talks.
The Bali negotiations had teetered on the brink of collapse due mainly to differences between India and other trading nations, led by the United States.
India - which aims to stockpile and subsidise grain for its millions of poor - had demanded that such measures be granted indefinite exemption from WTO challenge.
The US, which implements large farm supports of its own, and others, had said India's grain policy could violate WTO limits on subsidies. They also wanted assurances that stockpiles would not enter markets, skewing world prices. Compromise wording appeared to leave the exemption period open-ended.
A later hurdle emerged as four Latin American countries objected to the removal in the accord's text of a reference to the US embargo on Cuba, an issue that was eventually resolved.
Besides pledges to streamline customs and limit agricultural subsidies, the package included policies to aid least-developed countries. Mr Azevedo had warned that without a deal the WTO risked being sidelined by alternative regional pacts. These include the 12-country Trans-Pacific Partnership spearheaded by Washington. Mr Azevedo said such pacts could not protect the interests of the developing world's masses of poor - a key WTO objective.