RIO DE JANEIRO (Reuters) - Brazil will pull out of a United Nations pact on dealing with rising migration, the incoming foreign relations minister said, joining the United States and a growing number of countries in rejecting the agreement.

Slideshow ( 4 images )

Ernesto Araújo - who will take office in January under right-wing president-elect Jair Bolsonaro - said the international accord was “an inappropriate instrument” to deal with the issue and nations should set their own policies.

With a record 21.3 million refugees globally, the United Nations began work on the non-binding agreement after more than 1 million people arrived in Europe in 2015, many fleeing civil war in Syria and poverty in Africa.

The accord, which addresses issues such as how to protect migrants, integrate them and send them home, has been criticized by mostly right-wing European politicians who say it could increase immigration.

All 193 U.N. members except the United States agreed its wording in July, but only 164 - including representatives of Brazil’s current administration - formally ratified it at a ceremony in Marrakesh on Monday.

“The Bolsonaro government will dissociate from the Global Compact for Migration ... an inappropriate instrument to deal with the problem,” Araújo wrote on Twitter late that same say.

“Immigration shouldn’t be treated as a global issue, but rather in accordance with the reality of each country.”

Araújo said Brazil would continue to take in refugees from neighboring Venezuela, but that “the fundamental point is restoring democracy” in that nation.

Bolsonaro, who takes office on Jan. 1, has adopted what opponents have called a harsh stance on immigration. In 2015 he was quoted describing refugees coming to Brazil as “the scum of the earth”.

Ten countries, mostly in formerly Communist Eastern Europe, have announced they are pulling of the U.N. immigration pact, and a Chilean official said over the weekend Santiago would do the same.