By Steve Scherer

ABOARD RESCUE SHIP AQUARIUS (Reuters) - A day after reaching safety aboard a humanitarian ship, migrants on Friday told of arbitrary detention, slavery and beatings in Libya as Europe seeks to build up the Tripoli-based coastguard.

"Libya is crazy. They arrest us, the police ... They put us in some place ... two, three days no eat, no drink. They beat us," said Alseer Issa Ibrahim, 28, from the Darfur region of Sudan.

Ibrahim is one of almost 600 people on the Aquarius, a rescue ship operated by Medicins Sans Frontieres (MSF) and SOS Mediterranee, now heading toward an Italian port.

Six years after the fall of strongman Muammar Gaddafi, Libya appears to be sliding deeper into lawlessness. Smugglers are packing record numbers of people onto unsafe boats, with sea arrivals to Italy up 35 percent so far this year. More than 1,300 have died.

John Osifo, a 29-year-old Nigerian, spent 11 months in Libya. He said he did not plan to go to Europe, but after a few months working at a car wash, a local man destroyed his passport and work permit, making him an irregular migrant, and he was forced into hard labour.

In Libya "they believe blacks are slaves. That is what they call us. When they want to beat us, they beat us with pipes," he said, showing a scar on his left hand.

"They take us to jobs, force us to do hard labour without payment ... Sometimes they take you to a prison where you'll be kept and beaten up," he said, as the Aquarius's crew served tea and bread to the migrants.

The European Union and Italy agreed in February to funnel millions of euros to the United Nations-backed government in Tripoli to help it fight human trafficking and operate migrant centres to be managed by U.N. agencies. Mainly because it is too dangerous, these centres have yet to be opened.

But the capacity of Tripoli's coastguard is increasing. Humanitarian groups fear this will feed the lucrative smuggling business because migrants will be intercepted and taken back to Libya where they will be held in appalling government-controlled centres, only to try to make the crossing again at a later date.

Story continues

On Friday MSF, one of the few aid agencies entering the government-controlled camps, said in a statement it had witnessed adult malnutrition, overcrowding, violence-related injuries and lack of basic hygiene.

"In the first three months of 2017, interruptions in food supply were observed in two detention centres with detainees going for days without any food," MSF said. "As a result, MSF is treating adults suffering from malnutrition."

After the Libyan coastguard stopped almost 600 migrants on Thursday, Italy's embassy in Tripoli tweeted: "This is the right way forward."

"We are always suffering in Libya from hunger, and the Libyan people hate us. They don't look at us like people, they look at us like animals," said Yagob Mobark Ibrahim, 21, from Sudan.

(Reporting by Steve Scherer; Editing by Janet Lawrence)