The substantial rise in piracy incidents off the Horn of Africa since 2008 has exposed significant gaps in the international law framework for investigation and prosecution of piracy offences and its implementation in national criminal justice systems. This article examines the principal elements of this framework including the definition of piracy and associated obligations in the 1982 United Nations Convention on the Law of the Sea (LOSC). It reviews progress towards criminalisation of piracy offences in national legislative systems and distinctive trends in piracy legislation around the world. It also examines key features of the jurisprudence emerging from the regional and extra-regional prosecutions of Somali pirates as well as sentencing outcomes. The United Nations response to the deficit in criminal justice infrastructure for investigating, prosecuting and punishing Somali pirates through Security Council resolutions, the negotiation of the Djibouti Code of Conduct and the criminal justice capacity building efforts of the United Nations Office on Drugs and Crime is discussed. The principal thrust of these efforts has been to strengthen the capacity of countries in the Horn of Africa region to effectively investigate, prosecute and punish the offenders and to augment the overall efficacy of their criminal justice systems. An argument is made for forging stronger criminal justice cooperation networks in the Horn of Africa region and beyond to assist in gathering the necessary evidence and arresting piracy suspects for investigation and prosecution. The obstacles to tracking and freezing the proceeds of Somali piracy are also examined. The article concludes that although the prosecution of Somali pirates is only one component in the solution to eradicating the complex problem of Somali piracy, it is an indispensable element in ongoing efforts to deter this harmful criminal activity and in reducing its costs to the international community.