Brazilian President Michel Temer signed a decree Tuesday to send the army to "guarantee law and order" on the border with crisis-hit Venezuela after recent violent clashes.
Earlier this month, more than a thousand homeless Venezuelan immigrants who had flooded over the border into Brazil's northwestern Roraima state were driven back by an angry mob that rampaged through their makeshift tent following rumours a local shopkeeper had been brutally beaten by migrants.
Temer said his measure was aimed at providing "security for Brazilian citizens but also Venezuelan immigrants fleeing their country."
He also branded Venezuela's crisis as "tragic," saying it "threatens the harmony of practically the entire continent."
Temer called on "the international community to adopt diplomatic measures" to halt the Venezuelan exodus, as economic and political crises under President Nicolas Maduro's regime drive hundreds of thousands to leave in hope of finding a better life elsewhere.
"Brazil respects the sovereignty of other states but we have to remember that a country is only sovereign if it respects its people and looks after them," he added in an ominous warning to Maduro.
The United Nations says some 2.3 million Venezuelans are living outside their homeland, with 1.6 million of those having left since 2015.
Oil-rich but over-reliant, Venezuela is in a fourth year of recession brought on by a crash in oil prices in 2014. Some 96 percent of the country's revenue is generated through crude.
The exodus has strained Venezuela's neighbours, Colombia and Brazil in particular, but also other countries hosting thousands of migrants such as Ecuador, Peru and Chile.
Like Brazil, Peru has seen outbreaks of anti-Venezuelan xenophobia.
- Urgent situation -
"It's not just Brazil enduring the consequences, but Peru, Ecuador, Colombia and other Latin American countries," Temer said in a televised address.
"That's why we urgently have to find the way to change this situation."
Some 60,000 refugees are in Brazil, while Peru recently tightened its border controls on Venezuelans after seeing more than 400,000 enter the country.
Temer didn't reveal how many soldiers would be deployed to Roraima, but Defense Minister Joaquim Silva e Luna said "troops are already in place" at the border.
Security Minister Sergio Etchegoyen warned that Brazil "needs to discipline" the influx of migrants.
Meanwhile, Brazil said it was negotiating with Caracas to avoid Venezuela's state electricity provider Corpelec turning off the lights in Roraima over a $40 million unpaid debt.
Brazil can't pay it because of European Union and United States sanctions against Venezuela.
Brazil's Foreign Minister Aloysio Nunes told AFP the country wanted to settle its debt but was struggling to find "a financial path" without breaking "the restrictions and sanctions applied by Europe and the United States" against Maduro and his government.
Nunes said Brasilia has proposed an "exchange of accounts" since Venezuela is indebted to Brazil "far more than the $40 million we owe the company."
Any electricity cut would not only hit hard the small and impoverished state of Roraima, but also the thousands of Venezuelans who have fled there, thus exacerbating their already precarious situation.
Brazil has studied potential short and long-term solutions for Roraima's electricity but those are both costly and harmful to the environment, while there is also the possibility of inciting a territorial conflict with indigenous people in the area.