Military analysts reportedly warned that a pirate attack off Somalia was imminent because assets used in the European Union’s anti-piracy program have been diverted to the migrant crisis in the Mediterranean.

Alan Cole, the head of the United Nation’s maritime crime program on drugs and crime, told U.K.'s The Times newspaper that a high-profile attack was only a matter of time.

MORE THAN 60 KILLED IN ETHIOPIA LANDFILL COLLAPSE

The United Nations warned in October that the situation was fragile and that Somali pirates "possess the intent and capability to resume attacks." One expert said some in the region had let down their guard as the situation calmed. NATO ended its anti-piracy mission off Somalia in December.

Armed pirates are demanding a ransom for the release of an oil tanker they have seized off the coast of Somalia and the crew is being held captive, the European Union anti-piracy operation in the region announced late Tuesday.

BUS ESCAPING DEADLY CRASH STRIKES CROWD, KILLS AT LEAST 34

An EU Naval Force statement said the operation had finally made contact with the ship's master, who confirmed that armed men were aboard the Comoros-flagged tanker Aris 13.

An official in Somalia's semiautonomous state of Puntland said over two dozen men boarded the ship off the country's northern coast, an area known to be used by weapons smugglers and members of the Al Qaeda-linked extremist group al-Shabab. The official spoke on condition of anonymity because they were not authorized to speak to journalists.

The ship was anchored Tuesday off the town of Alula, said Salad Nur, a local elder. "The ship is on the coast now and more armed men boarded the ship," he told the AP by phone.

Monday's hijacking was the first such seizure of a large commercial vessel off Somalia since 2012. It came as a surprise to the global shipping industry as patrols by the navies of NATO countries, as well as China, India and Iran, had suppressed Somali pirate hijackings for several years.

A Somali pirate who said he was in touch with the armed men aboard the tanker said the amount of ransom to demand had not yet been decided.

Bile Hussein told The Associated Press that the armed men have locked most of the crew in one room and cut off communication lines. "Their main concern now is a possible rescue attempt, so that's why all communications were cut off in the afternoon," he said.

The Aris 13, manned by eight Sri Lankan sailors, was carrying fuel from Djibouti to Somalia's capital, Mogadishu, when it was approached by men in two skiffs, said John Steed, the director of Oceans Beyond Piracy. The EU statement said the ship's master issued a mayday alert.

The EU Naval Force said it had passed the information from its contact with the ship's master to the oil tanker's owners and an investigation was underway.

Sri Lanka's Foreign Ministry said in a statement it was in touch with shipping agents and officials abroad for more information to help ensure the crew's "safety and welfare."

A U.N. shipping database shows the Aris 13 is owned by Armi Shipping SA, whose address is listed in care of Aurora Ship Management FZE, a company based in the United Arab Emirates. Calls and emails to Aurora went unanswered.

The incident involving the Aris 13 represents the first commercial pirate attack off Somalia since 2012, Steed of Oceans Beyond Piracy said.

"The pirates never went away, they were just doing other forms of crime and if any of the measures reduce (which they have, or ships take risks) the pirates are poised to exploit the weakness," he said in an email.

Somali pirates usually hijack ships and crew for ransom. They don't normally kill hostages unless they come under attack.

Piracy off Somalia's coast was once a serious threat to the global shipping industry. It has lessened in recent years after an international effort to patrol near the country, whose weak central government has been trying to assert itself after a quarter-century of conflict. In that time, concerns about piracy off Africa's coast have largely shifted to the Gulf of Guinea.

But frustrations have been rising among local fishermen, including former pirates, at what they say are foreign fishermen illegally fishing in local waters.

Nur, the local elder, told the AP that young fishermen including former pirates have hijacked the ship.

"They have been sailing through the ocean in search for a foreign ship to hijack since yesterday morning and found this ship and boarded it," he said. "Foreign fishermen destroyed their livelihoods and deprived them of proper fishing."

The Associated Press contributed to this report.