Somali pirates who hijacked an oil tanker on Monday have released the ship and its eight Sri Lankan crew, officials say.
It came after a gunfight between naval forces from the semi-autonomous state of Puntland and the gang, followed by negotiations involving local elders.
An unnamed former British army officer said: "The Puntland maritime police force freed the ship. They made (the pirates) an offer they couldn't refuse and the pirates have left."
The reported offer was not disclosed but a pirate confirmed the Comoros-flagged Aris 13 was released without a ransom being paid.
The gang said they agreed to forego a ransom after finding out that Somali businessmen had hired the tanker.
Pirates have traditionally been wary of getting caught up with the country's powerful businessmen.
Aris 13 had been anchored a few miles off the Somali coast near the town of Alula.
Naval forces have now boarded it and were escorting the ship to Bossaso port, the region's commercial hub.
The pirates were not arrested and were allowed to leave.
On Thursday, there were clashes between maritime forces and the hijackers who started shooting at each other. Local residents said four civilians were injured by stray bullets.
Three days earlier, the ship was taken over by the gang who arrived in two small boats. Most of the crew were held captive in a locked room.
It was the first hijacking in the region for five years, and maritime experts have accused ship owners of becoming complacent after a long period of calm.
The tanker, which was making its way from Djibouti to the Somali capital Mogadishu, had changed its course, heading towards the coastline of the northeastern tip of Somalia.
The cost and time saving route, paired with the ship's slow speed and lack of armed escort, left it vulnerable to attack.