Pirates have hijacked an oil tanker off the coast of Somalia, Somali officials said on Tuesday. This is the first hijacking of a large commercial vessel on the crucial global trade route since 2012.

The Aris 13 on Monday reported being approached by two skiffs, John Steed from Oceans Beyond Piracy said. The ship had been carrying fuel from Djibouti to Somalia’s capital, Mogadishu, he said. Eight Sri Lankan crew members were reportedly aboard.

An official in the state of Puntland said over two dozen men boarded the ship off Somalia’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 the press.

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

An official based in the Middle East with knowledge of the incident told AP that no ransom demand had been made.

“The vessel’s captain reported to the company they were approached by two skiffs and that on one of them they could see armed personnel on board,” the official said. “The ship changed course quite soon after that report and is now anchored.” The official spoke on condition of anonymity as no one was authorised to speak publicly about the incident.

It was not immediately clear who owned the ship or where it was flagged. Mr. Steed said it was an United Arab Emirates-owned and Sri Lankan-flagged, but the Middle East-based official said it was Greek-owned and Comoros-flagged with plans to re-flag it to Sri Lanka. Such ships often are reflagged and sold many times.

A Britain-based spokeswoman for the European Union Naval Force operation off Somalia, Flt. Lt. Louise Tagg, confirmed that an incident involving an oil tanker had occurred and an investigation was underway. The U.S. Navy’s 5th Fleet, which is based in Bahrain and oversees anti-piracy efforts in the region, did not immediately respond to a request for comment.

This would be the first commercial pirate attack off Somalia since 2012, Mr. Steed said.

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 central government has been trying to assert itself after a quarter-century of conflict.

Somali pirates usually hijack ships and crew for ransom. They don’t normally kill hostages unless they come under attack, including during rescue attempts. A United Nations report accessed by the AP in November said Somali pirates retain the capacity and intent to resume the attacks and lately have shifted to targeting smaller foreign fishing boats.

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. It was flying under the flag of Liberia at the time. It was not immediately clear if the companies were still linked to the ship.

Argyrios Karagiannis, the managing director of Flair Shipping, declined to comment. Calls and emails to Aurora went unanswered.