A 40-year-old man has been detained under the Mental Health Act after a major sea operation involving a yacht.
Holyhead coastguard followed the yacht around Anglesey
Police officers disguised as lifeboatmen arrested a man after flares were fired at a rescue boat during a three-hour drama at sea.
A 23-foot yacht was taken from a marina in Conwy early on Thursday morning and sailed around the north Wales coast to Holyhead.
About 50 people were evacuated from Holyhead marina early on Thursday.
Armed police were called in and lifeboats from Llandudno, Conwy and Holyhead all followed the yacht.
Police Superintendent Gwion Jones said flares had been fired towards people in the lifeboat.
Police said the incident began at Deganwy Yacht Club, near Llandudno late on Wednesday.
The yacht was followed by Llandudno lifeboat to Point Lynas, Anglesey, where Holyhead lifeboat took over.
Police said the man on the yacht encountered difficulties and asked that the Holyhead lifeboat tow him.
Because flares had been fired, a firearms team from North Wales Police worked with the coastguard and Holyhead lifeboat.
Holyhead marina was evacuated as the yacht was brought in.
Yacht owner Christian Mach was one of those moved.
"As the dinghy was put alongside the marina, we saw about 20 or 30 armed police spring out of nowhere," he said.
"They managed to overcome a man and frogmarch him out of the marina."
Police confirmed armed officers carried out the arrest, and the man was taken into custody - he is being questioned in Caernarfon.
The people moved from their boats at Holyhead marina were taken to the town's lifeboat station, but have now been allowed to return.
Inspector Derek Roberts, of North Wales Police, praised the effective co-operation between the lifeboat, coastguard and the police.