SÃO PAULO — The European Union on Friday reached a trade agreement with Brazil, Argentina and two other Latin American nations, with the goal of forging closer commercial ties among regions that are home to 780 million people with combined trade and services worth over $1 trillion.

Officials on both sides of the Atlantic hailed the agreement, struck after two decades of negotiations, as a powerful endorsement of multilateral trade at a time when global protectionism is on the rise.

The agreement is the largest ever concluded by the European bloc and it represents an important victory for the presidents of Brazil and Argentina, who have been championing free trade in a region with notoriously closed economies. Their alliance, known as Mercosur, also includes Uruguay and Paraguay.

“I measure my words carefully when I say that this is a historical moment,” Jean-Claude Juncker, the president of the European Commission, said at the end of negotiations in Brussels. “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.”