The Italian navy has recaptured a Sicilian fishing boat hours after it was seized by the Libyan coastguard up to 64km off the coast of Libya.
Italian navy personnel boarded the vessel, which was taken to the Libyan port of Misrata before being released.
The Libyan coastguard said the boat was seized in "a peaceful operation" after entering Libyan waters.
The vessel did not have a fishing permit and had breached Libyan sovereignty, a spokesman told the BBC.
"It was a peaceful operation, no shots were fired," he said.
The Italian navy said that military personnel in the area on migrant rescue duties responded to reports of the fishing boat seizure. There were no reports of any injuries.
The crew, which had been fishing for shrimp, comprised three Italians and four Tunisians resident in Italy.
A spokesman for the Italian fishing co-operative told the BBC that there have been 12 such seizures by Libya since 2005.
The gunmen initially appeared to be militia members using an unmarked government boat, the spokesman said.
The fishing co-operative has described the incident as "an act of piracy" and said that, since 2005, Libya has insisted that its territorial waters extend more than 112km (69 miles) off shore - much further than international agreements allow.
The co-operative said Libya's deteriorating security situation - the country is in effect fragmented with rival parliaments backed by warring militias - had added to concerns about the safety of the crew.