LAREDO, UNITED STATES (AFP) - They started work in the cool of the morning and moved quickly, uncoiling reel after reel of vicious-looking fencing and tying it with barbed wire to green poles hammered into the ground.

Over the course of three days, a gleaming, shoulder-high barrier of concertina-wire emerged like a silver snake along a lush riverbank, stretching as far as the eye could see.

This was the work of 100 or so American troops from the 19th Engineer Battalion, based in Fort Knox, Kentucky.

Rather than finding themselves in a far-off war zone, the soldiers are in Laredo, a busy border town overlooking a stretch of the Rio Grande river in south-west Texas, carrying out controversial orders from President Donald Trump.

He has sent about 5,800 troops to the border to forestall the arrival of large groups of Central American migrants travelling through Mexico and towards the US, in a move critics decry as a costly political stunt to galvanise supporters ahead of midterm elections earlier this month.

Before the election, Mr Trump called the matter a "national emergency" and warned that so-called migrant caravans were an "invasion" with "some very bad thugs and gang members".

So far at least, the most visible aspect of Mr Trump's deployment is the fence, a visible deterrent and physical obstacle to migrants, designed to corral would-be asylum seekers towards organised points of entry into the US.

Residents with cakes

Over the weekend, Lieutenant Alan Koepnick's platoon could be seen stringing concertina wire, which is built to snag clothing, along one edge of a quiet riverside park near downtown Laredo.

As families walked dogs, grilled sausages and relaxed, the soldiers mounted the wire, occasionally ripping their camouflaged uniforms on its metal barbs.

Lt Koepnick said some Laredo residents had voiced disquiet about the fencing and the presence of US troops.

"But there's also been a lot of support, people coming in, vets shaking our hands, bringing us cakes, water, things like that," he told AFP.

About 90m behind him, a group of people on the Mexican side of the river could be seen standing on the bank.

"You'll see people across the river cursing at us in Spanish, throwing bottles at us. But on this side it's more positive," Lt Koepnick said.

He and his soldiers were unarmed, but a group of armed military police officers stood by to provide "force protection". Under US law, the military is not allowed to conduct domestic law enforcement in most cases, so soldiers here will not have any direct interactions with migrants.

Mr Trump created a media whirlwind by sounding the alarm about the migrant caravans before the Nov 6 elections. He has mainly stopped raising it since, though last week he praised the military's work.

"They built great fencing, they built a very powerful fence," said Mr Trump, who wants to build a hardened wall along the entire 3,200km border.

Ms Laura Pole, a British tourist visiting Laredo for the third time, was less enthusiastic.

"It reminds me of Hitler and the concentration camps," she said, but added: "I really don't know what's the best thing to do.".

Related Story Trump backtracks on suggestion US troops could fire on migrants

Related Story Donald Trump signs order limiting migrant asylum at US-Mexico border

No risk of combat

The border mission has put the supposedly non-political military in an uncomfortable spotlight.

Defence Secretary Jim Mattis has hit back at critics who say the Pentagon should not be doing Mr Trump's political bidding, saying "we don't do stunts".

He visited troops on the border last week and reiterated that their job in the short term was to assist under-resourced Customs and Border Protection (CBP) agents and put up physical obstacles.

But "longer term, it's somewhat to be determined", he said.

After some rank-and-file troops grumbled about the purpose of the mission to US media last week, they are now under strict instructions not to voice personal opinions to the press.

Several soldiers AFP spoke to said their time on the border provided valuable real-world training, albeit without the risks of combat.

"We have a very large group of brand-new soldiers and it's really good for them," Corporal Samuel Fletcher said, citing a chance for the green troops "to do real work and put their skills to use".

Focus on Tijuana

In Laredo, large groups of migrants from the caravans in Mexico had not arrived.

Instead, they were mainly headed to Tijuana, about 2,100km away in San Diego, where the authorities say more than 3,000 have already arrived.

Still, a CBP agent, who was not authorised to give his name, said he was glad of the military assistance, as each day, "hundreds" of migrants attempt to cross the approximately 48km stretch of border he patrols.

The military deployment is set to wrap up on Dec 15 and it is not clear what will become of the wire fencing.

Already, the winds whistling down the Rio Grande valley are strewing trash, clothing and plastic bags along the jagged wire.

"Nobody seems to know when it's coming down. It's not really our decision," said Lt Koepnick.

"If we are told to take it down, we will take it down with a smile on our faces, like good soldiers."