* Foreign workers may be trapped in Libya
* Flow through Tunisia border dries up (Adds comments by U.N. aid chief, paragraphs 7-8)
RAS JDIR, Tunisia, March 4 (Reuters) - Foreign workers trying to flee violence in Libya may be trapped or prevented from reaching the Tunisian border, the United Nations refugee agency said on Friday after the flow of refugees dried up.
The number of people crossing through this border post two hours' drive west of the Libyan capital Tripoli had topped 100,000 by Thursday but then plummeted.
"The UNHCR is concerned that the security position in Libya is preventing people from leaving," Firas Kayal, the agency's spokesman on the spot, said.
The UNHCR also noted reports from journalists escorted to the frontier by Libyan officials in the past 24 hours found it almost deserted, apart from well-armed government troops.
Foreigners have begun fleeing into Algeria as forces loyal to Libya's Muammar Gaddafi guarded exit routes to Tunisia and Egypt, international aid groups said.
An Algerian journalist at Debdeb, on Algeria's border with Libya, said some 30 refugees crossed on Friday "but we are expecting a couple of hundred of refugees, mainly Chinese and Bangladeshi, to cross in the coming hours."
There was no exact figure for how many of an estimated 1.5 million foreign workers in Libya may have left the country in the past two weeks of unrest. But U.N. humanitarian chief Valerie Amos said on Friday more than 172,000 people had left Libya, "mainly migrant workers returning to their homes."
Amos told reporters in New York she would travel to Tunisia on Friday evening to see what more the United Nations could do. U.N. Secretary-General Ban Ki-moon has said he will appoint an envoy to coordinate humanitarian aid in the Libyan crisis.
In Tunisia on Friday, up to 10,000 heavily laden Bangladeshis trudged from their makeshift camp inside the border on foot to a nearby transit camp, while Egyptian refugees piled onto Tunisian city buses for evacuation by air.
The UNHCR said 43,000 Egyptians had been repatriated and only 4,000 to 5,000 remained. "We are now concentrating our efforts on the Bangladeshis," Kayal said.
Officials at the airport in Djerba expected 50 evacuation flights to take off during the day. A German ship was due to dock further north to join the operation.
Loaded with baggage and weak with hunger, they walked slowly in single file along the road from the border to the camp in a line 4 km (2.5 miles) long, as yellow city buses packed with evacuees streamed by.
"No buses for us," one man said with a smile.
The refugee flow began on Feb. 21 and reached a peak on Tuesday and Wednesday, with chaotic scenes of desperation and panic at the border.
The U.S. military was flying aid supplies to Tunisia on Friday and will return there on Saturday to evacuate refugees who fled violence in Libya, the Pentagon said.
Colonel David Lapan, a Pentagon spokesman, said two C-130 transport planes were bringing 4,000 blankets, 40 rolls of plastic sheeting and almost 10,000 water containers from U.S. facilities in Europe to Djerba.
Lapan said the aircraft left a U.S. air base in Germany before picking up supplies from a U.S. Agency for International Development warehouse in Italy.
"They will drop off supplies, depart and, at this point, we are expecting them to return sometime tomorrow to move refugees," Lapan said.
About 1,800 people crossed the border from Libya on Thursday, the UNHCR said. That was about a tenth the number who surged through in one day earlier this week, threatening to swamp Tunisia's capacity to process the desperate arrivals.
On Friday only a few small groups were seen crossing.
Speaking at the transit camp where he has established a mobile hospital, Tunisian Army colonel Mohamed Essoussi said: "We made a few little mistakes at the beginning but we have the situation under control now."
Many refugees were arriving exhausted, and had to be screened for injuries, sickness and contagious disease.
Drivers of the yellow city buses requisitioned for the airport shuttle were wearing surgical masks. Essoussi said the UNHCR and Tunisian Army camp could take 17,000 people at a time "and if 17,000 are moved out, then 17,000 more can move in."
Some estimates say perhaps half of all the foreign workers in Libya may have left by now, to the east via Benghazi, which is in the hands of anti-Gaddafi forces, or from Tripoli and even from the remote south of the vast desert state to Niger.
"Of course we must foresee the worst, and if there is a surge we will be able to take more people and provide more logistical and medical and paramedical help," Essoussi said. (Additional reporting by Maria Golovnina in Tripoli, Patrick Worsnip at the United Nations and Missy Ryan in Washington; editing by Bill Trott)