El Salvador's president said Thursday his government can do nothing to stop migrants fleeing criminal violence in the Central American country and heading to the United States.

"We cannot avoid that kind of migration -- one that is motivated by the issue of violence or motivated by family reunifications," President Salvador Sanchez Ceren said before a cabinet meeting.

US President Donald Trump has responded angrily to a caravan of some 5,000 migrants which has made its way through Central America to Mexico on its way to the US border.

Labeling it a "national emergency," Trump ordered troops to the southern US border and threatened to cut aid to El Salvador and its Central American neighbors for failing to stop the caravan and others that are beginning to head north.

Sanchez said his government and those of Guatemala, Honduras and Mexico are seeking to implement measures "to reduce the phenomenon" of Central American migration to the United States.

"This phenomenon -- which started in Honduras and continued here in El Salvador -- has put the issue of migrants back into a situation where some measures need to be taken on our part, to make those who want to emigrate see the reality they will meet in the United States and in Mexico, the risks that they run in crossing."

Nearly 2,000 Salvadorans left at the end of October, saying they were fleeing gang violence in the country.

Sanchez said that according to government figures, about 1,750 Salvadorans have joined migrant caravans moving through Mexico. Some 200 gave up and returned home, he said.

He said his government was working to generate the economic conditions and "development opportunities" to encourage people to stay at home.