The first global trade reform since the creation of the World Trade Organization is ready for agreement by ministers from the body’s 159 member countries later on Friday, sources involved in the talks said.

WTO Director-General Roberto Azevedo has drafted a text that he will submit to the full membership, signalling that he believes he has found terms that are acceptable to all members, including India which had raised vocal objections over agriculture.

Barring any last-minute veto, the deal aims to slash red tape at customs around the world, give improved terms of trade to the poorest countries, and allow developing countries to skirt the normal rules on farm subsidies if they are trying to feed the poor.

It would also revive confidence in the WTO’s ability to negotiate global trade deals, after a string of failures that left the body at risk of sliding into irrelevance.

“We are very close,” WTO spokesman Keith Rockwell told reporters at the meeting on the Indonesian resort island of Bali. “As things stand now, the prospects are promising.”

Just a day earlier, a deal that would add hundreds of billions of dollars to the world economy by some estimates teetered on the brink of collapse.

In an organization based on consensus among all of its members, attention focused squarely on India as the main stumbling block to the WTO’s first global trade deal in two decades.

India has insisted it would not compromise on a policy of subsidising food for hundreds of millions of poor, putting it at odds with the United States and other developed countries.

Azevedo, a former Brazilian trade negotiator, told delegates at the start of the last day of talks that there was more work to be done, but sounded upbeat on prospects for success.

“He told members they were now very close to something that has eluded us for many years and that the decisions over the next few hours would have great significance beyond this day,” the spokesman said.

It is 12 years since the WTO launched the Doha Round, which failed to yield concrete results, and many experts had warned that failure in Bali would leave regional and bilateral trade arrangements as the only avenue for trade reform, dividing the world and reversing the globalising goal of the WTO.

A Bali trade deal, which is far less ambitious than the Doha Round had aimed for up until two years ago, would open the way to much wider trade reforms and enable the body to modernize its rules for the internet era.

The “all or nothing” agreement covers several areas, the largest of which is trade facilitation – a global standardisation and simplification of customs procedures that would tear down barriers to cross-border movement of goods.

The deal also includes limited reforms in agriculture, including reducing export subsidies, opening borders to least developed countries, and the food subsidy policy championed by India, which proved the biggest obstacle.

SEEKING JUSTICE FOR THE POOR

India, whose government faces the risk of losing elections next year, has said its tough stance drew support from developing countries in Asia, Africa and South America, though the meeting’s host, Indonesia, pressed for it to soften its stand.

“We are trying to get justice for the poor people,” Indian Trade Minister Anand Sharma told reporters as he entered the final day of the meeting.

India will next year fully implement a welfare programme to provide cheap food to 800 million people that it fears will contravene WTO rules curbing farm subsidies to 10 percent of production.

The programme, which relies on large-scale stockpiling and purchases at minimum prices, is a central plank of the government’s bid to win a third term in office next year.

A proposal led by the United States offered to waive the 10 percent rule until 2017. But India has rejected it, demanding the exemptions continue indefinitely until a solution is found.

If talks were to fail, the WTO may see its role eroded by regional trade pacts now being negotiated, such as the U.S.-led 12-nation Trans-Pacific Partnership and a U.S.-EU tie-up known as the TTP.

Ministers in the TPP are expected to meet in Singapore shortly after the WTO meeting in the hopes of reaching a free trade pact by the end of this year.

(Editing by Jonathan Thatcher and Simon Cameron-Moore)