The release came several hours after a gunfight on Thursday between naval forces and the pirates, followed by negotiations between the marines and the pirates.
"We shall kill the crew if Puntland forces fire on us again", pirate Abdullahi told Reuters.
The Aris 13, a Comoros-flagged tanker belonging to a Greek company, was en route from the Somali capital Mogadishu to Djibouti, Somalia's northern neighbor, when it went missing off the coast near a town called Alula (Caluula).
Abdirizak Mohamed Ahmed, the director of Puntand's anti-piracy agency, confirmed the release of the ship Thursday night and said naval forces had boarded it to escort it to port.
When Merkel met Trump
Mrs Merkel sought to break the ice, saying that it was "much better to talk to one another than about one another ". Mr Trump said the U.S. would do "fantastically well" in its trade relations with Germany.
At the time the tanker was taken it was forced to change course and head toward Puntland.
Many Somalis, including former pirates, depend on fishing to make a living.
Prior to 2012, when the hijackings stopped thanks to the joint efforts of shippers and several navy fleets, Somali pirates made millions from ransoming, keeping some crew members in captivity after the ransom was paid, sometimes for years.
Maritime and Somali regional officials say the hijackers moved the ship to Haabo from its original location off the coast of Alula to the west. Hijacking attacks resulted in hundreds of hostages being held for ransom.
Rebels Leave Al-Waer Under Government Evacuation Deal
But the opposition decries them as a tactic of forcibly displacing people who oppose Assad after years of bombardment and siege. Residents and fighters from the last remaining rebel stronghold in the Syrian city of Homs are facing a life or death choice.
Lt Commander CRP Walakuluge said that Aris 13 was vulnerable to piracy because it was sailing close to the coast to save on fuel and was also going slowly.
Piracy off Somalia's coast used to cost the world's shipping industry billions of dollars and was seen as a major threat.
Coastal Somalis, including pirates who quit as global patrols increased and became fisherman, have complained of growing harassment by illegal fishermen and attacks by large foreign trawlers.
Australian government records from 2014 show the ship in Monday's incident was owned by Flair Shipping Trading FZE in the United Arab Emirates and linked to UAE-based ship management firm Aurora Ship Management FZE.
Cheltenham: Gold Cup day
With her step father as her trainer and her mother part-owner of the horse she is riding, it is very much a family enterprise. The grand Gold Cup Chase which is the biggest event of the festival is set to be won by Djakadam and Rupert Walsh.