A South American trading bloc that includes Brazil, Argentina and Uruguay agreed Tuesday to close its ports to ships flying the flag of the disputed Falkland Islands, Uruguay’s president said.

The presidents of the Mercosur countries agreed at a summit here that ships flying the Falklands flag “should not dock in Mercosur ports, and if that were to happen, they should not be accepted in another Mercosur port,” Uruguay’s President Jose Mujica said.

A statement issued at the end of the summit said member countries would adopt “all measures that can be put in place to impede the entry to its ports of ships that fly the illegal flag of the Malvinas Islands.”

Argentina’s President Cristina Kirchner, who took over the presidency of the trade bloc from Mujica, thanked her fellow presidents for the show of support for Buenos Aires in its dispute with Britain over the South Atlantic archipelago.

The two countries fought a brief but bloody war in 1982 over the islands, which are known as the Malvinas in the Spanish-speaking world.

Argentina and Britain have renewed diplomatic ties since the war, but the dispute has heated up again as British companies have begun exploring for oil in waters surrounding the islands, which lie 400 nautical miles from the Argentine coast.

In mid-September, the British company Rockhopper Exploration announced that it hopes to begin oil production in the region in early 2016 and have a maximum output 120,000 barrels per day by 2018.

The decision announced by Mujica would close ports of Argentina, Uruguay and Brazil to Falklands flagged ships.

The Uruguayan president last week announced that his country would bar Falklands ships from Uruguayan ports, prompting Britain to call in the Uruguayan ambassador to express its concern.