The European Union anti-piracy operation in the region says the pirates are holding the eight Sri Lankan crew members captive and demanding a ransom.
The official, who spoke on condition of anonymity because he was not authorized to speak to the media, said pirates on the ship were continuing to receive reinforcements while regional forces mobilizing nearby. The pirates drained the tanks of the tanker and stole all the fuel on board, but also demanded for ransom to release the vessel.
The release followed a gunfight earlier in the day between the pirates and the marine force, and then intensive negotiations between the marine force, clan elders and the pirates.
The pirates seized the Comoros-flagged Aris 13 tanker on Monday, the first such hijacking in the region since 2012, and took it to the port of Alula in the semi-autonomous northern region of Puntland.
"We tried to intercept a boat that was carrying supplies to the pirates, but the pirates on the ship fired on us and so the pirate boat escaped", said Abdirahman Mohamud Hassan, the director general of the maritime force of Puntland.
A Somali pirate who said he was in touch with the armed men aboard the tanker said they have locked most of the crew in one room and cut off communication lines.
However, John Steed, a former British army officer who has spent years negotiating the release of piracy hostages in Somalia, told the AFP news agency they had been made an offer they could not refuse.
Lukaku says he will not sign new contract, in blow for Everton
Chelsea and Manchester United want to sign the Belgian and are plotting a summer swoop for the unsettled Lukaku. The Everton striker is joint top scorer in the English Premier League this season with 19 goals.
Steed said an unknown number of people had been injured in the exchange of gunfire. EU Naval Force sent a maritime patrol aircraft from Djibouti to overfly the tanker, trying to make radio contact. The Aris 13 was about 18 kilometres off the Somali coast when it was attacked, according to Steed.
The incident came against a backdrop of reduced piracy activities in Somalia.
"These are fishermen who are infuriated with the illegal fishing off their coasts".
The ship was anchored off the town of Alula, said Salad Nur, a local elder. At the peak of the piracy epidemic in January 2011, 736 hostages and 32 boats were held.
However, some smaller fishing vessels have recently been seized in the area.
Steed says the global community had taken significant steps to improve security, boosting naval forces in the area and requiring ships to take protection measures.