Seven suspects have been detained after a suspected hijacking involving stowaways on a tanker off the Isle of Wight.
UK special forces completed the operation in nine minutes, BBC Defence Correspondent Jonathan Beale said.
Military assistance had been requested after the stowaways on board the Liberian-registered Nave Andromeda reportedly became violent.
The crew, who were locked in the ship’s citadel, are safe.
The Ministry of Defence called the incident a “suspected hijacking” and said Defence Secretary Ben Wallace and Home Secretary Priti Patel authorised the operation in response to a police request.
Mr Wallace said: “I commend the hard work of the armed forces and police to protect lives and secure the ship.
“In dark skies, and worsening weather, we should all be grateful for our brave personnel. People are safe tonight thanks to their efforts.”
Mrs Patel tweeted she was “thankful for the quick and decisive action of our police and armed forces who were able to bring this situation under control, guaranteeing the safety of all those on board”.
Mr Beale said the individuals were detained after they were met with “overwhelming force”.
He said members of the Special Boat Service based at Poole, in Dorset, were involved in the operation, which also featured six helicopters.
A team of Royal Navy divers were also flown in one of the Royal Navy helicopters in case the vessel had been mined but it had not.
Concerns over the crew’s welfare were raised at 10:04 GMT when the vessel was six miles off Bembridge, police said.
A spokesman said “verbal threats” had been made towards the crew.
A three-mile exclusion zone was put in place around the vessel.
Richard Meade, editor of shipping news journal Lloyd’s List, had earlier said there were thought to have been seven stowaways on board.
He said it was believed they had become violent towards the crew after they attempted to detain them in a cabin.
The 240ft-long (73m) ship is known to have left Lagos in Nigeria on 5 October and was south of the Isle of Wight when the police were called.
Lawyers for the vessel’s owners said they had been aware of the stowaways on board for some time.
Tobias Ellwood, chairman of the Commons Defence Committee, said the boarding of the tanker was a “good outcome”.
He said: “Seven stowaways on board taking over a ship or causing the ship not to be in full command would have triggered a multi-agency alarm and then well-rehearsed classified protocols were then put into action.”
In December 2018, four stowaways were detained after they ran amok on a container ship in the Thames Estuary.
The men, from Nigeria and Liberia, waved metal poles and threw faeces and urine after being found hiding on the Grande Tema.
Paul Clifton, BBC South transport correspondent
The tanker Andromeda, owned by Greek shipping company Navios, was en route from Lagos in Nigeria to Fawley oil refinery on Southampton Water.
It had not stopped anywhere else.
According to a source close to the shipping company, the crew were aware of stowaways on board, but the stowaways became violent towards the crew while it was off the Isle of Wight.
The crew retreated to the ship’s citadel, a secure area in which they can lock themselves, making it impossible for attackers to get in.
This is standard procedure during a terrorist or pirate attack, but there is no suggestion the crew were doing more than protecting themselves from the stowaways.
The crew contacted the coastguard, which then alerted police.
Navios are a long-established shipping company with a good reputation.