MOGADISHU, Somalia — Somali officials say pirates have hijacked a ship off the coast of the Horn of Africa nation. It is thought to be the first hijacking of a large commercial vessel there in about three years.

One official in the semiautonomous state of Puntland said the incident occurred on Monday. The official said over two dozen men boarded the merchant ship off Somalia’s northern coast.

Another official in Puntland said the ship is a Sri Lankan-flagged freighter and was being moved toward the coast. Both officials spoke on condition of anonymity because they were not authorized to speak to the press.

A spokeswoman for the European Union Naval Force operation off Somalia, Flt. Lt. Louise Tagg, confirmed that an incident involving an oil tanker had occurred off the coast of Somalia and an investigation was underway.

Piracy off Somalia’s coast was once a serious threat to the global shipping industry. But 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.

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

Salad Nur, an elder in Alula, a coastal town in Puntland, told The Associated Press by telephone 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.”

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 seen by the AP in November said it had been almost three years since Somali pirates successfully hijacked a large commercial vessel, but they retain the capacity and intent to resume the attacks and lately have shifted to targeting smaller foreign fishing boats.

The EU force website currently lists no vessels or hostages held by pirates.

Concerns about piracy off Africa’s coast have largely shifted to the Gulf of Guinea.