Somali piracy was once estimated by the World Bank to cost global trade billions of dollars and to harm the fragile economies of countries in the region.

These disastrous financial costs came alongside a raft of pain and suffering for those taken hostage, some of whom died due to desperate living conditions and a lack of medical treatment.

Now, in the last few weeks, Somali piracy is back: making headlines, boarding ships, and taking hostages. Since early March, there have been numerous successful attacks including, on April 1, when the cargo ship Al Kaushar was boarded.

Despite the region’s harrowing history, the five-year let-up in serious attacks has led to a collective forgetting about the dangers of Somali piracy. Hard-won lessons about veering too close to the Somali coastline and having visible security seem to have been thrown overboard in favour of time and cost savings. Navy patrols have decreased due to other priorities that tax the scarce resources of countries.

There are four things that need to be done if we are to avoid a rerun of the early part of this decade when attacks on shipping numbered in their hundreds.

First, it is imperative that the international community remains vigilant and commercial shipping follows the advice of navies and the International Maritime Organisation when planning safe passage through the sea corridors off Somalia.

Second, job creation aids crime prevention. What is done on land impacts action at sea. We should acknowledge that the promise of pirate riches is enough to bait the hook for the impoverished and jobless.

A survey of 66 imprisoned pirates by the UN Office on Drugs and Crime and Oceans Beyond Piracy found poverty was a key reason for their criminal activity.

Advocacy about the dangers of life on the high seas, and the creation of sustainable livelihoods on land are essential. Piracy’s relationship with illegal fishing, which depletes Somalia’s resources, also needs to be fully examined.

Third, the pursuit of fair criminal justice systems so pirates can be prosecuted, and if found guilty, jailed in safe and secure prisons back in Somalia. So far, 1,300 young Somali men have been held on suspicion of piracy and processed through the courts of 21 states.

UNODC, and its Nairobi-based Global Maritime Crime Programme, assists regional states in the trial and prosecution of suspected pirates, as well as supporting piracy's many victims. Hostage release efforts are ongoing and UNODC has been involved in the freeing of 150 hostages, including last October’s release of 26 crew members from the FV Naham 3.

Stopping pirates from becoming terrorists is a priority. We run one of the world’s largest programmes on preventing violent extremism in the prisons where pirates are held.

Fourth, Somali maritime law enforcement agencies need to be fully supported with resources and equipment, so they can extend their reach beyond the Somali coast.

Many of these subjects will be discussed at a conference in London next month, attended by António Guterres, the UN secretary general, Theresa May, the UK prime minister, and Mohamed Abdullahi Mohamed, the Somali president. Our own work in these areas is a model for the support offered to countries. The UN and the international community can be justly proud of these achievements; however, the London conference can build momentum for future action.

Somalia and the Horn of Africa are beset by numerous challenges, but as countries find hope in oil exploration and breathe new life into struggling economies, piracy attacks are an ever present threat to recovery. For the sake of the people of Somalia, the international community needs to remain vigilant and to help where needed. This is no time to be caught all at sea.

Yury Fedotov is the executive director of the UN Office on Drugs and Crime