A volatile build-up of weapons and resentment along the northern Somali coast culminated in the hijack of an oil freighter this week, the first such seizure by Somali pirates since 2012, experts and locals say.

Gunmen hijacked the Aris 13, a small oil tanker, on Monday and are demanding a ransom to release the ship and its eight Sri Lankan crew, the European Union Naval Force that patrols the waters off Somalia said on Wednesday.

Now shipping companies are scrambling to find out whether the attack is a one-off, or whether pirates could once again threaten one of the world's most important shipping lanes and cost the industry billions of dollars annually.

The other side of Somalia's pirates

Somali forces have been sent to try to free the tanker.

But locals say the attacks will continue and blame their government in the semi-autonomous Puntland region for granting foreigners permits to fish in Somali waters.

"Since the fish are drained by foreigners, my colleagues plan to go into the ocean to hijack other ships. We have no government to speak on our behalf," said fisherman Mohamed Ismail.

Although Somalia remains mired in violence and poverty, the Horn of Africa nation has shown some small signs of progress in recent years despite a civil war lasting more than a quarter of a century. A return to piracy could derail those fragile gains.

Monday's hijack followed a long hiatus in pirate attacks, with only four unsuccessful attempts in the past three years.

The lull encouraged foreign fishing vessels to return to Somali waters, locals told Reuters news agency, fuelling resentment.

"If you look at the sea at night, there are so many lights out there [from fishing vessels]. It looks like New York," complained one former Somali official who asked not to be named.

Somali pirates hijack ship with Sri Lankan crew on board

The final straw, he said, was when seven Thai fishing vessels docked at Bosaso port last month. The ships paid the local government more than $672,000 for fishing licences, a government contract showed. The move infuriated locals who felt they would see neither fish nor the cash.

"When I saw those ships come into Bosaso port in broad daylight, I knew there would be an attack," he said. "The fishermen became desperate."

Only 14 foreign vessels are licensed to fish, including the seven Thai vessels, the Puntland government said. All others are illegal, said Ali Hirsi Salaad, director of Puntland's Ministry of Fishing.

"Fisherman are right to complain," he said.

Weapons ashore

Matt Bryden, the head of Nairobi-based think-tank Sahan Research, said coastal communities were rearming amid widespread anger at the failure to crack down on foreign fishing vessels.

He displayed several photographs that he said were of a recent shipment of assault weapons, saying that so many were arriving that in one area the price of a PKM machinegun had fallen from $13,000 in October to about $8,500 last month.

"The price is going down because so many are being imported," he said.

The same source sent him a photo of the sea's horizon at night, he said. The lights of at least 23 vessels that the man said were fishing boats glowed on the horizon.

"Coastal communities are angry at the foreign vessels and at the authorities who they believe have licensed some of them," he said.

A Bosaso-based weapons dealer said orders for rocket-propelled grenades, machineguns, and ammunition had increased.

Jonah Leff, a weapons tracing expert with Conflict Armament Research, said many pirates had turned to smuggling. They take boatloads of people to Yemen and return with weapons, he said.

"There's been an influx of weapons," he said.