The largest humanitarian rescue ship in the Mediterranean Sea was patrolling calm waters on 17 August when sailors spotted a boat approaching from the Libyan coast.

It was coming too fast to be one of the flimsy dinghies used by hundreds of thousands of migrants to attempt the treacherous crossing to Europe, and was not responding to contact.

Staff on the Médecins Sans Frontières (MSF) ship activated their “code red” protocol, taking cover in the Bourbon Argos’s mess.

Aid workers, used to false alarms over local fishermen, started to relax, making cups of coffee and snacking on biscuits until they could get back to work. But then the gunfire started.

Benjamin Hargreaves, the Bourbon Argos's British deck manager, described how the chartered ship’s crew ran downstairs from the bridge shouting: “Shooting! Shooting!”.

Staff fled to a fortified room below decks as the unidentified gunmen boarded the ship. Some sat down to write letters to their families, fearing the messages could be their last.

“We didn’t know who they were, why they were here and what they were going to do,” Mr Hargreaves said, recounting the “traumatic” two hours before staff got the all-clear to venture out from their hiding place.

A day rescuing refugees from the Mediterranean Sea

They emerged to find the Bourbon Argos riddled with bullet holes. One went through glass windows on the bridge, inches from where a security officer had been watching the approaching boat through binoculars.

Another passed through the back of the vessel, through the door of the men’s toilets, the mirror above the women’s sink and another partition wall before entering the on board hospital.

Evidence of the bullet’s path through the ship – a series of holes filled in during emergency repairs – was examined by The Independent in November.

With no refugees on board at the time, the Bourbon Argos was largely empty, and no one was injured.

The armed men left without removing anything from the ship, sparking fervent speculation over whether they may have been from one of the numerous armed groups fighting in the continuing Libyan civil war or even Isis, which controls part of the country’s coast.

But they were revealed to be from the Libyan coastguard – a supposed ally of Britain in the EU in the ongoing refugee crisis – which claimed staff mistook MSF for a gang of oil smugglers.

The attack on the Bourbon Argos is among several serious incidents involving the force, which is accused of shooting, beating and torturing refugees trying to reach safety in Europe.

One charity had one of its rescue boats confiscated and the German volunteers on board detained, while another organisation is pursuing a legal case against the Libyan coastguard for allegedly causing the deaths of up to 25 migrants.

Ruben Neugebauer, from Sea-Watch, said the German charity is attempting to launch legal action over the incident on 21 October.

In pictures: A day of refugee rescues in the Mediterranean Sea Show all 7 1 /7 In pictures: A day of refugee rescues in the Mediterranean Sea In pictures: A day of refugee rescues in the Mediterranean Sea A baby being taken on to MSF's Bourbon Argos ship from a boat carrying 130 migrants and refugees Lizzie Dearden In pictures: A day of refugee rescues in the Mediterranean Sea A refugee boat carrying 101 people being rescued by MSF's Bourbon Argos Lizzie Dearden In pictures: A day of refugee rescues in the Mediterranean Sea A refugee boat carrying 101 people being rescued by MSF's Bourbon Argos all images by Lizzie Dearden In pictures: A day of refugee rescues in the Mediterranean Sea A baby among refugees on a boat carrying 185 people off the coast of Libya Lizzie Dearden In pictures: A day of refugee rescues in the Mediterranean Sea Migrants and refugees sleeping after being rescued by MSF's Bourbon Argos ship Lizzie Dearden In pictures: A day of refugee rescues in the Mediterranean Sea A crew from MSF's Bourbon Argos ship rescuing a boat carrying 130 migrants and refugees off the coast of Libya, at sunrise Lizzie Dearden In pictures: A day of refugee rescues in the Mediterranean Sea A woman in a stretcher being lifted onto MSF's Bourbon Argos ship from a boat carrying 130 migrants and refugees off the coast of Libya Lizzie Dearden

He told The Independent the Libyan coastguard interrupted an ongoing rescue operation, cutting off the charity’s boat as it handed out life jackets to around 150 people on board.

“One of them boarded the refugee boat and he was hitting them with an object we can’t define,” Mr Neugebauer said. In the ensuing panic, up to 25 refugees are believed to have fallen into the sea and drowned.

Sea-Watch was only able to pull four unconscious people from the water, with distraught staff salvaging four dead bodies.

“We had a feeling it was an attempt to push back this vessel because there was no other reason for them to interfere with our rescue,” Mr Neugebauer said. “I’m sure that no one would have died if we had been able to carry on handing out life jackets.”

A Libyan Navy representative told local television the Sea-Watch boat was not “attacked” but admitted there was an incident, claiming the boat was in Libyan waters – an allegation denied by the charity.

The Libyan coastguard is known to have forcibly returned thousands of migrants caught attempting to flee the country to land, with asylum seekers describing being beaten and tortured at detention camps where they are kept in horrific conditions.

A report by the Office of the UN High Commissioner for Human Rights found that migrants were being imprisoned, robbed, raped and subjected to force labour after “dangerous, life-threatening interceptions” by the Libyan coastguard.

A 17-year-old boy from Guinea told the UN the coastguard “shot at migrants randomly” when his boat was intercepted in March, killing at least three people dead and injuring several more.

Desperate journeys: Rescued at sea, refugees detail abuse in Libya

A girl from Eritrea, aged just 14, claimed officials killed a man presumed to have steered a dinghy she was travelling and beat the other passengers after they were taken to land.

And the horrific account is not an isolated one. Abdurrahman, a 23-year-old Eritrean man, told Amnesty International he was among asylum seekers beaten with hoses and wooden sticks.

“They then shot one man in the foot – he was the last one coming off the boat so they asked him where the driver was,” he added. “When he said he didn’t know, they said ‘that means you are the driver’ and they shot him.”

The UN’s mission in Libya also says it has received reports indicating some members of the coastguard “have worked with armed groups, smugglers and traffickers to exploit migrants for profit”, as well as selling on the engines of seized migrant boats.

It is urging Britain and other countries training the Libyan coastguard to ensure its “human rights component is comprehensive” and that migrants are protected.

Amnesty International warned that the EU’s expanding cooperation with Libya risks “fuelling rampant ill-treatment” and violations of international law.

“Europe shouldn’t even think about migration cooperation arrangements with Libya if it results, directly or indirectly, in such shocking human rights violations,” said Magdalena Mughrabi, the group’s interim deputy director for the Middle East and North Africa.

A repaired hole from a bullet fired by the Libyan coastguard on MSF rescue ship the Bourbon Argos (Lizzie Dearden)

“The EU has repeatedly shown it is willing to stop refugees and migrants from coming to the continent at almost any cost now, with human rights taking a back seat,” she said.

A spokesperson for the EU told The Independent it was backing “legitimate Libyan authorities” to develop their capacity at sea but had no direct involvement in coastguard operations.

“The EU is aware of the reported incidents which have allegedly occurred,” she added.

“The EU’s programme of capacity delivery to the Libyan coastguard places particular emphasis on humanitarian and migration issues, as well as on women's rights issues.”

When asked under what circumstances the support would stop, she said the EU was ensuring “correct standards are maintained”, without providing details.

A spokesperson for the Libyan Navy claimed the Bourbon Argos, sails under several large red and white MSF banners, was mistaken for an oil smuggling ship.

“The guards shot in the air to warn them but because our boat is small and was swaying due to heavy waves there might have been a hit to their boat,” he said. “I confirm that it was not directly targeted.”

The Ministry of Defence is aware of the reported attacks but is understood not to be leading investigations into alleged abuses as it continues its training programme.