Walking barefoot, Dominic Ongwen took a westerly course across the tropical savanna in the Central African Republic where it meets the border of Sudan. The Ugandan rebel leader had been on the run for days from Joseph Kony, the notoriously elusive chief of Lord’s Resistance Army (LRA). After 30 years as a rebel, from child soldier to commander, Ongwen had fallen out of favour with Kony and had three options: face likely execution, escape, or die trying.

Ongwen met a group of cattle herders, who led him to a group of former rebels. A succession of phone calls eventually brought news of his defection to US and Ugandan soldiers in Obo, 500km south, who had been hunting him for six years. US special forces flew Ongwen to their base by helicopter. It was January 2015.

Ongwen agreed to record a message to lure other LRA commanders out of the bush. “I am now a free man despite the ICC [International Criminal Court] case against me,” Ongwen said on the recording, addressing his old comrades. He sounded confident, boastful even, mentioning the quality of the women and the luxury of his quarters. “Even the president has agreed to forgive me,” he said.

It could have been a textbook example of the US and Ugandan strategy to encourage LRA defection, and a catalyst to dismantle the remains of the group (who reportedly now number less than 100, down from up to 4,000 fighters in 1997). Except Ongwen wasn’t going to get amnesty. Under pressure from the Obama government to show results, the US transferred him swiftly to the ICC in The Hague.

Human rights defenders in Uganda felt Ongwen was deceived, which undermined a basic tenet of criminal law – truth – and prompted criticism of the ICC from many people in northern Uganda who support granting amnesty to former rebels who were abducted as children.

As a result, Ongwen’s trial has swollen from a simple trial to a do-or-die chance to prove the validity – or not – of the ICC at a time when it is undergoing an existential crisis.

The ICC was founded with the idealistic goal of trying the perpetrators of the world’s worst atrocities – genocide, war crimes and crimes against humanity. The dream was to offer victims justice and to act as a deterrent. After the post- second world war criminal trials in Nuremberg and Tokyo, the UN security council established two temporary courts in response to atrocities committed in Rwanda and former Yugoslavia during the 1990s. Seeing the efficacy of international justice, the world sought to establish a permanent court from which no leader, rebel group, junta or army could hide. In 1998, leaders met in Rome and 120 of them voted for, and later ratified, the Rome Statute, creating the ICC.

To escape being kidnapped and forced to become child soldiers, every night thousands of Ugandan children would walk to sleep safely in towns. Photograph: Simon Townsley/Rex

The court’s first referral was in 2003 when Uganda’s President Museveni asked it to investigate the LRA in northern Uganda. The rebel group had been waging war on the Ugandan army for over a decade, recruiting children through abduction, making sex slaves of girls, and forcing boys to kill their loved ones.

But by 2016, when the ICC finally brought a member of the LRA, Ongwen, to trial, Museveni had turned on the “useless” court, criticising it of “western arrogance”. He told Der Spiegel: “This is our continent, not yours”.

This mistrust of the ICC is echoed across the African continent. Last year, South Africa, Burundi and the Gambia’s stated intention to quit as members of the court, and talk of a mass African exodus promoted Kofi Annan to pen an impassioned call for African nations to support the ICC.

Meanwhile, nationalism and disdain for globalised organisations is rising in the west. President Donald Trump has made clear his intention to slash funding for international programmes. Although the US, as a non-member, does not support the ICC directly, it shares intelligence, supports logistics, funds a rewards programme, and is traditionally a major donor to international tribunals.

International law is premised on the idea that nations can’t be separate – they must work in harmony. Diminished funding, cooperation, political will and engagement from Europe and America could severely hamper progress towards the UN sustainable development goal 16, to promote peaceful and inclusive societies, justice for all, and effective, accountable institutions at all levels.

So how can we hope to improve international justice for all, and achieve the goal, if its main institution – the ICC – is under threat from multiple directions?

Critics highlight the fact that nine out of its 10 investigations to date have focused on Africa

Even with its unprecedented territorial reach and independence, the court has flaws. Without an international police force, it relies on the cooperation of member states, and among its leaders are those the court may one day have to prosecute. Critics highlight the fact that nine out of its 10 investigations to date have focused on Africa. The court also stands accused of inefficiency, having cost over $1bn (£800m) with a current annual operating budget of €145m (£123.9m) but only convicted four people.

The ICC, says Ugandan human rights lawyer Nicholas Opiyo, made mistakes with the LRA case from the outset. When then chief prosecutor Luis Moreno Ocampo announced the investigation in Uganda, he stood shoulder-to-shoulder in a London hotel with President Museveni. “The court turned up with one of the parties to the conflict,” Opiyo says, effectively vindicating the Ugandan army – which also committed serious crimes – of responsibility in the Ugandan civil war.

If Ongwen is prosecuted it would be “justice for the Ugandan government as opposed to justice for the victims,” says Opiyo. The trial appears foreign and confusing to victims as it is geographically removed. “To the victims of the LRA, including my own sister, justice means peace,” he says. “Victims do not see justice as incarceration; that is not their concern.”

People watch the start of the ICC trial of Dominic Ongwen in Lukodi, Uganda on December 6, 2016. Photograph: Isaac Kasamani/AFP/Getty Images

The debate over the best way to pursue justice in Uganda has raged for years. In 2008, Kony’s representatives visited the ICC to negotiate. The LRA and the government had finalised a peace agreement, but Kony would only sign it if the ICC dropped their case. The court considered his demands, but ultimately rejected them. “What was the impact of that? The LRA is still going and Kony is still at large,” says Yvonne McDermott Rees, senior lecturer at Bangor Law School, who specialises in international criminal law.

The problem with international criminal law is that, unlike domestic criminal law, it’s idealistic, McDermott Rees says. “The international justice project sets a huge number of goals: to set a historical record, establish peace and security, end impunity, deter future offenders and lead to the reestablishment of the rule of law. But at the end of the day, these are criminal trials and as such their core purpose is to determine criminal liability.”

What are the alternatives to the ICC?

African leaders have proposed an alternative home-grown solution: the African Court of Justice and Human Rights (ACJHR). The ACJHR would be the world’s first regional court with criminal jurisdiction over genocide, war crimes and crimes against humanity. Other regional courts such as the European and inter-American courts of human rights have no such power to prosecute and sentence but offer judgments and recommendations.

ACJHR has, however, one glaring flaw: the proposed court would grant sitting heads of state and “senior state officials” immunity. This would strengthen the ICC’s role as the court of last resort and provide an incentive for leaders who commit crimes to hold on to power indefinitely. For the ACJHR to have criminal jurisdiction, 15 member states need to to ratify the agreement known as the Malabo protocol, but to date only nine states have signed it and not one has ratified it.

Alternatives to the ICC are limited. In some cases, national governments step in using the principle known as “universal jurisdiction”, which allows a state to try to prosecute people for war crimes and crimes against humanity committed outside their territories. In February, a Swedish court sentenced a former Syrian opposition fighter living in Sweden to life in jail for war crimes. Other countries, including Germany, France, Norway, the Netherlands and Switzerland, are also investigating crimes committed in Syria.

The international community has failed to prevent the atrocities in Syria. The UN security council, tasked with maintaining global peace, tried to refer the conflict to the ICC in May 2014 but was blocked by Russia and China. Frustrated by their obstruction, the UN general assembly voted in December 2016 to create a special mechanism for Syria to investigate crimes committed since 2011 “in order to ensure the preservation of evidence and enable effective accountability in the future”. Amnesty International described this as “a glimmer of hope for accountability,” and Human Rights Watch hailed it a demonstration that the general assembly “can take the reins on questions of justice in the face of security council deadlock”.

In defence of the court, experts argue that because of its unprecedented mandate, the ICC is perpetually perceived as being “in crisis” and that, as a newly created court, mistakes were inevitable.

The ICC is in the process of addressing some of its failings, by improving its evidence gathering and corroboration, and improving the security of investigators and witnesses. In the early years, the court’s strategy was to gather only enough evidence to secure an arrest warrant, then build on that evidence to confirm the charges, gathering the requisite evidence in stages. By limiting the evidence they collected early on, the court often overlooked, or struggled to access, key information at a later stage. “A number of these problematic practices have not only been recognised and acknowledged but are in the process of correction,” says Richard Dicker, director of Human Rights Watch’s international justice programme.

The leadership of Burundi thinks the ICC poses a significant enough threat to initiate a withdrawal Mark Kersten, Justice in Conflict

The court is also aware of, and seeking to address, accusations of bias against weaker states – in particular, African nations. The court currently has 10 preliminary examinations underway. Of these, only four are in Africa. If the preliminary examination in Afghanistan turned into a full investigation, it would be the first international tribunal to investigate US nationals. The move would be unlikely to result in an arrest since the US, as a non-signatory, would not be obliged to hand over citizens. But it would address the court’s perceived bias, and might discourage torture in the future.

Whether the Afghanistan case goes ahead or not, a mass African withdrawal from the ICC looks increasingly unlikely. Gambia’s new president told the EU on 9 February that the country would repeal its decision to leave. A month later, South Africa reversed its decision to leave. While Burundi remains belligerent, its exit – which takes a year to activate – will not impact the ICC’s ongoing preliminary investigation into crimes committed there.

Mark Kersten, creator of the Justice in Conflict blog, says Burundi’s looming exit proves the ICC is effective. “The leadership of Burundi thinks the ICC poses a significant enough threat to initiate a withdrawal,” he says. “[The ICC] needs to make people uncomfortable.”

Meanwhile, hearings at Ongwen’s trial at The Hague are scheduled until July. The outcome of his case, in which he is charged with 70 counts of war crimes and crimes against humanity, will set an important precedent for international criminal justice. The court has never before heard a case in which the accused is a child soldier – the LRA abducted Ongwen as a 10-year-old boy as he walked home from school – and thus both victim and perpetrator.

Opiyo, the human rights lawyer who as a child was one of the tens of thousands of Ugandan children who walked miles to sleep somewhere safe from LRA abductions, believes that Ongwen’s prosecution would be “a partial justice” to the victims, but nevertheless an important first step on the “justice continuum”. He believes the ICC represents “the best option for victims of grave human rights violations to attain justice,” despite its flaws.

Join our community of development professionals and humanitarians. Follow @GuardianGDP on Twitter. Join the conversation with the hashtag #Dev2030.