Scores of migrants in the French port of Calais have tried to force their way onto a ferry bound for England, officials and witnesses say.
Passenger John Bailey told the BBC that the migrants had tried to run up the ship's main ramp but the crew raised it and turned a fire hose on them.
The migrants were detained by French police, the UK Border Force said.
On Tuesday the mayor of Calais said she would blockade the port unless Britain helped to control the migrants.
Natacha Bouchart said that her city was being "taken hostage" by more than 1,000 migrants attempting to cross the English Channel from France.
Officials said that two attempts were made to board MyFerryLink ship Berlioz. In the first about 85 migrants forced their way through a gate and climbed over fences, overpowering security staff.
They were foiled when crew raised the ramp before they could get to the ferry.
"The crew took immediate action to ensure the ship's security and the attempt was unsuccessful," a ferry company spokesman told PA.
A second attempt - made by about 150 migrants who also succeeded in gaining entrances to the port - was frustrated when police moved in to detain them.
"The migrants were escorted back down the ramp by the police and led out of the port, shouting at some people in the vehicle queue," Mr Bailey said.
"The ship was delayed by about 45 minutes whilst a search was carried out."
Another ship, Spirit of Britain, was about to dock at Calais at the time but the ferry's operator P&O said the crew had waited in the inner harbour until the incident was over. The company said there had been a "huge intrusion" at the port and told the AFP news agency it had prompted it to close the doors to the ship.
Mr Bailey told the BBC that on his way to the port he and fellow passengers "were shocked to see a huge crowd of migrants on the main access road who were being guarded by about 20 French police - some armed with sub-machine guns".
"This was clearly no deterrent as they obviously ran past them into the port, which must have been a distance of about a mile," he said.
Ms Bouchart said that the migrants were costing the French authorities too much and were making life unpleasant for people in the city.
"What have we got to do for [the] English to listen to us?" she tweeted on Tuesday, accusing the UK government of failing to tackle the issue for the past 10 years.
Many of the migrants in Calais believe the UK will be a more welcoming place if they can get there.
In 2002 the French government closed the main Red Cross centre at Sangatte near Calais, but insanitary illegal camps have constantly sprung up in its place since then.
In recent months French police have tried to break up the camps, but the migrants say they have nowhere else to go. They can often be seen sheltering under plastic bags and sheets, with many depending on charities for food.
UK Deputy Prime Minister Nick Clegg said on Thursday that Home Secretary Theresa May had been in touch with the French government on the issue and added: "We will do whatever is needed with the French authorities to make sure that our border is safe."
The mayor of Calais argued that British immigration policy made the UK look like "an Eldorado" to immigrants.
She criticised Britain for demanding that security be boosted at Calais on the one hand without sufficiently financing the 10m euros ($13m; £7.8m) improvement project on the other.
Calais is the nearest French port to England and millions of British tourists travel through the town every year.