The Mercosur headquarters in Montevideo. (AFP)

The European Union and South American trade bloc Mercosur sealed a blockbuster trade deal Friday, ending 20 years of talks over one of the world's largest regional commercial accords, negotiators said.

The agreement came after two decades of often tough negotiations between the EU and the countries of Mercosur -- Argentina, Brazil, Paraguay and Uruguay -- which had repeatedly stalled because of European farmer sensitivities over the beef market.

The deal was announced as the US administration of President Donald Trump faced several bilateral disputes, including trade tensions with China and disagreements with EU countries.

"I measure my words carefully when I say that this is a historical moment," European Commission President Jean-Claude Juncker told reporters on the sidelines of the G20 in Osaka.

"In the midst of international trade tensions, we are sending today a strong signal with our Mercosur partners that we stand for rules-based trade."

In a strong show of unity, all the European and Mercosur leaders also members of the G20 gathered for a joint photo, with Argentine President Mauricio Macri also hailing a "historic day."

European farmers concerned

The trade pact is the largest ever concluded by the EU, Juncker said in a statement released in Brussels, and would save European companies more than four billion euros ($4.5 billion) worth of trade duties every year.

It covers markets that total approximately 780 million consumers, an EU statement said.

Brazil welcomed a "historic" agreement with the EU, while Argentina called the deal "unprecedented".

The announcement of the deal, details of which were not revealed and which must be approved by the 28 EU member states, comes as leaders of the world's most powerful economies gather in Osaka, Japan, for a G20 summit.

Once implemented, it is tipped to eliminate 99 percent of agricultural and industrial tariffs on both sides and facilitate exchanges in services and government procurement, reduce technical barriers, and effect sanitary and phytosanitary measures and intellectual property.

The agreement has nonetheless raised concerns of European farmers who fear unfair competition, as well as NGOs concerned about consequences for the climate.

Challenges to EU farmers

"Today's agreement also presents some challenges to European farmers and the European Commission will be available to help farmers meet these challenges," the EU's agriculture commissioner Phil Hogan said in a statement.

"For this agreement to be a win-win... carefully managed quotas will ensure that there is no risk that any product will flood the EU market and thereby threaten the livelihood of EU farmers."

The 28-member EU currently accounts for about one-quarter of global gross domestic product (GDP) at 18 trillion euros ($20 trillion).

Finalisation of the talks had been complicated by French President Emmanuel Macron, who threatened to scrub the deal if Brazil withdrew from the Paris climate accord that commits signatories to reducing greenhouse gas emissions and which Brazil's President Jair Bolsonaro has threatened to leave.

"If Brazil leaves the Paris accord, we could not sign trade deals with them," Macron said Thursday night in Japan en route to Osaka for the G20 summit.

"The reason is simple, we are requiring our farmers to stop using pesticides... our businesses to reduce emissions. That has a competitive cost," Macron added.

Cognac and Manchego cheese

Activists had urged the EU to halt the Mercosur trade talks over Brazil's alleged harm to its rainforests and indigenous peoples in order to benefit influential agribusinesses.

For Europe, the deal would mean greater access to large South American automobile markets and respect for so-called protected geographical indications such as Cognac or Manchego cheese.

The EU is also counting on the agreement to improve access to the South American market for telecommunications, transport or financial services.

Mercosur countries in return hope to export up to 99,000 tonnes of beef to Europe a year before they have to pay tariffs, alongside stronger exports of ethanol, sugar and poultry.

The EU and Mercosur exchange 88 billion euros in goods annually, with a balance very slightly in favour of the Europeans (+2.5 billion euros).