Somali pirates released a hijacked oil tanker and its eight Sri Lankan crew on Thursday, a Somali security official and the pirates said.
The release followed a gunfight earlier in the day between the pirates and the marine force, and then intensive negotiations that included clan elders as well.
"There has been discussion going on after the gunfight of this afternoon ... We pulled our forces back and so the pirates went away," said Abdirahman Mohamud Hassan, the director general of the maritime police force for Somalia's semi-autonomous northern region of Puntland.
The vessel was hijacked on Monday.
A pirate confirmed the release was made without a ransom payment.
The pirates said that they agreed to forego a ransom after learning that Somali businessmen had hired Aris 13, which was taking oil from Djibouti to the Somali capital of Mogadishu. Pirates have traditionally been wary of tangling with Somalia's powerful businessmen.
Anger over illegal fishing
The hijacking was the first time Somali pirates have taken over a commercial ship since 2012 and followed an outpouring of anger by locals over foreign fishermen flooding into their waters. The Somalis are also angry with their government for licensing some of the ships.
Village elders in Alula where the hijacked vessel first docked, said the pirates had not made clear demands, but claimed to be driven by anger over illegal fishing.
"These are fishermen who are infuriated with the illegal fishing off their coasts. They desperately need to show their grievances by seizing the boat," said Abdiwahab Ahmed, an elder in Alula.
Somali pirates began staging waves of attacks in 2005, seriously disrupting a major international shipping route and costing the global economy billions of dollars.
At the peak of the piracy crisis in January 2011, 736 hostages and 32 boats were held.
Though anti-piracy measures ended attacks on commercial vessels, fishing boats have continued to face attacks.