Image caption The deal was finally agreed after marathon talks in Bali

Ministers from 159 countries have reached a deal intended to boost global trade at a meeting in Bali, Indonesia.

The World Trade Organization's first comprehensive agreement involves an effort to simplify the procedures for doing business across borders.

There will also be improved duty-free access for goods sold by the world's poorest countries.

The deal, which could add about $1tn to world trade, gives developing nations more scope to increase farm subsidies.

"For the first time in our history, the WTO has truly delivered," said WTO chief Roberto Azevedo, as the organisation reached its first comprehensive agreement since it was founded in 1995.

Analysis Bureaucratic barriers to commerce can be a big problem. Africa, for example, has the longest customs delays in the world. The African Development Bank says it can take 36 hours to get goods through the customs post at the Victoria Falls crossing from Zambia into Zimbabwe. And there are often more barriers to negotiate once goods are over the border. The highway between Lagos and Abuja in Nigeria has 69 official checkpoints. It takes time and costs money dealing with these delays. It can be disastrous for a cargo of perishable goods. These are exactly the kind of barriers that the WTO deal is intended to tackle. Dealing with them would certainly make it cheaper for business to move goods across borders. And if it's cheaper, they will do more of it.

"This time the entire membership came together. We have put the 'world' back in World Trade Organization," he said.

Indonesian Trade Minister Gita Wirjawan said the deal would "benefit all WTO members".

UK Prime Minister David Cameron said the "historic" agreement could be a "lifeline" for the world's poorest people, as well as benefiting British businesses to the tune of more than $1bn (£600m).

However, the "Bali package", as the WTO calls the agreement, was criticised by some development campaigners who said it was not going far enough.

Rich and poor

It is worth spelling out what is not covered by this: tariffs or taxes on imported goods.

Dealing with them has been the bread and butter of past trade rounds - but not for this deal.

The core of this agreement is what is called trade facilitation. This is about reducing the costs and delays involved in international trade. It is often described as "cutting red tape".

Some analysts suggest the benefits could be large. An influential Washington think tank has put the potential gains to the world economy at close to $1tn and 20m million jobs.

The negotiations have failed to secure permanent protection for countries to safeguard the food rights of their peoples John Hilary, War on Want

It also estimates the cost of administrative barriers as double the cost of tariffs.

The rich countries have agreed to help the poorer WTO members with implementing this agreement.

Another important aspect of the Bali package deals with enabling poor countries to sell their goods more easily. This part is about tariffs, and also quota limits on imports.

Rich countries and the more advanced developing countries have agreed to cut tariffs on products from the poorest nations.

EU trade commissioner Karel De Gucht told the BBC that if the poorest nations "have more trading capacity it will also result in more investment in logistics and infrastructure".

But campaigners describe the plan as weak.

Nick Dearden of the World Development Movement said: "If the US and EU really wanted to tackle global poverty, they would have made the least-developed-countries package much stronger."

Media playback is unsupported on your device Media caption WTO chief Roberto Azevedo: "For the first time in our history, the WTO has truly delivered"

Credibility test

Getting this deal has involved introducing some extra flexibility into the existing WTO rules on farm subsidies. India led the campaign, by insisting that it should be allowed to subsidise grain under its new food security law.

There is a strong possibility that India's policy would break WTO rules that limit farm subsidies.

A "peace clause" has been agreed, under which members agree not to initiate WTO disputes against those breaching the subsidy limits as part of a food-security programme. But it only lasts four years and there is criticism from campaigners.

John Hilary of War on Want, a UK-based group, said: "The negotiations have failed to secure permanent protection for countries to safeguard the food rights of their peoples, exposing hundreds of millions to the prospect of hunger and starvation simply in order to satisfy the dogma of free trade."

Image caption Traditional dancing was performed at the WTO meeting in Bali

The Bali meeting was an important one for the WTO's credibility. The deal includes a rather small part of the negotiating programme that was launched 12 years ago, known as the Doha Round.

Repeated delays have made the WTO seem irrelevant as a forum for negotiating trade liberalisation agreements. It was one of the main reasons so many countries have sought to make deals bilaterally or among small groups.

The agreement will help repair the WTO's damaged image. Nonetheless, the rest of the Doha Round will be very difficult to conclude.

The deal seeks further reductions in farm subsidies, tariffs on industrial goods, barriers to international trade in services and more.

All are very difficult to conclude and are entwined with domestic political factors in many of the WTO's 159 member countries.

So don't hold your breath waiting for the final deal.