Hundreds of Venezuelan migrants have crossed back over the border with Brazil in the last few days after a violent incident in Boa Vista, the capital of Roraima state.
Most said they were leaving because they feared for their lives after a young man was lynched, accused of killing a local man during a robbery.
They were picked up by buses sent by the Venezuelan government.
Brazil has accepted over 30,000 Venezuelans fleeing economic chaos.
Many of the migrants had been living on the streets of Boa Vista with no sanitation or water in improvised plastic and wooden shelters.
Many locals say they resent their presence, complaining of the smell and the mess left in public spaces.
Police were investigating the stabbing of a local man who had allegedly got into a fight with a Venezuelan after a robbery at a supermarket.
The Venezuelan man was attacked and beaten to death by a group of Brazilian men.
Tensions have been rising on the Brazilian-Venezuelan border where hundreds of people cross daily into Brazil fleeing Venezuela's severe economic crisis.
Most of the migrants continue further south heading towards other countries in South America.
But around 30,000 have stayed in the border region in the state of Roraima.
Earlier this month, 1,200 migrants fled back across the border from the Brazilian town of Pacaraima after locals attacked a street encampment, burning possessions and tents.
The local authorities in Brazil have complained they do not have the resources to deal with the migrants and are receiving no support from the central government.
In response, two weeks ago Brazilian President Michel Temer ordered the military to the border area to provide security.
In Peru, a group of 90 Venezuelans decided to return home on planes sent by their government as part of a plan to repatriate Venezuelan nationals named "Return to the Country".
The Venezuelans had gathered at the embassy in the capital, Lima, and from there were taken to the airport.
The Spanish news agency Efe said some had thanked Venezuelan President Nicolas Maduro "for hearing their prayers" after having gone through a difficult situation in Peru.
Peru has accepted 430,000 migrants the second largest group in the Americas after Colombia.