All charges against Kenya’s president have been dropped by the international criminal court (ICC), highlighting the tribunal’s difficulties in bringing to justice the high-ranking officials it has accused of atrocities.

With a show of reluctance, the chief prosecutor, Fatou Bensouda,on Friday filed a notice withdrawing allegations against the president, Uhuru Kenyatta. She accused the Kenyan government of harassing and intimidating potential witnesses.

“Given the state of the evidence in this case, I have no alternative but to withdraw the charges against Mr Kenyatta,” the Gambian lawyer explained. “I am doing so without prejudice to the possibility of bringing a new case should additional evidence become available.”

He added: “This is a painful moment for the men, women and children who have suffered tremendously from the horrors of the post-election violence, and who have waited, patiently, for almost seven years to see justice done.”

Kenyatta had been charged with crimes against humanity including murder, rape, persecution and deportation as an “indirect co-perpetrator” in violence that flared after Kenya’s 2007 elections, leaving more than 1,000 people dead.

The collapse of the case is a new blow to the credibility of the court’s prosecution office. The office has begun nine full investigations since it was established in 2002, all of them in Africa, and has just seven suspects in custody.

Reacting to the news on Friday, Kenyatta said he was excited and called for a case against his deputy, William Ruto, and another Kenyan to be dropped as well. “One down, two to go,” he said.

Kenyatta’s British lawyer, Steven Kay, said the court and its prosecutors “owe [Kenyatta] an apology for bringing proceedings based upon false witnesses and impugning his integrity”.

Kenyatta’s trial was postponed twice this year while prosecutors attempted to shore up their case after one of their key witnesses refused to testify and another admitted giving false evidence.

Kenyatta was indicted in 2011 but went on to become president in the 2013 election, using his indictment at The Hague-based court as an election issue. His government lobbied hard to have the case against him deferred by the UN security council, arguing that the delay was essential because Kenya needed its leader to help fight al-Shabaab terrorists in neighbouring Somalia and at home.

The court’s mission is to prosecute perpetrators of atrocities when a country is unwilling or unable to prosecute them itself. It has no police force and must rely on help from governments that may only wish to cooperate when it suits their political purposes.

In her statement, Bensouda blamed the Kenyan government for obstructing her investigations. “Contrary to the government of Kenya’s public pronouncements that it has fully complied with its legal obligations in this case, the ruling has confirmed that in fact it has breached its treaty obligations under the Rome statute by failing to cooperate with my investigation,” she said.

“I have persistently sought to secure the cooperation that my office required from the government of Kenya in this case in order to execute my mandate. Crucial documentary evidence regarding the 2007-08 post-election violence, including concerning the conduct of the accused, can only be found in Kenya and is only accessible to the prosecution through the assistance of the government of Kenya. This crucial assistance was ultimately not provided, as confirmed by the recent decision of the trial chamber.”

Bensouda said prosecutors had also endured a “steady and relentless stream of false media reports about the Kenya cases, an unprecedented campaign on social media to expose the identity of protected witnesses in the Kenya cases [and] concerted and wide-ranging efforts to harass, intimidate and threaten individuals who would wish to be witnesses.”

In October, Kenyatta became the first head of state to appear before the ICC. He temporarily handed over power to his deputy, William Ruto, before flying to The Hague. The international statute that established the ICC removed the principle that serving heads of state or governments should be granted immunity from prosecution under international law. He had previously appeared before being elected president.

The African Union, which represents countries across the continent, has accused the court of focusing its hearings excessively on African countries. Kenya has cooperated with the ICC while Sudan’s president, Omar Hassan al-Bashir, has defied repeated summons to appear.

Bensouda last month requested an indefinite postponement, saying Nairobi had refused to cooperate with a request for financial statements and other statements leaving her without enough evidence for a trial.

On Wednesday, however, the ICC rejected the prosecutors’ request for a further adjournment, directing instead that they either withdraw charges or proceed to trial. The court also dismissed a prosecution request for a finding of “non-cooperation” against Kenya.

“The decision to drop charges against President Kenyatta is devastating to the thousands of survivors who saw the court as their last hope for holding one of Africa’s most powerful leaders accountable,” said Karen Naimer, director of the Program on Sexual Violence in Conflict Zones at Physicians for Human Rights (PHR). “The collapse of this case is a serious blow to the international criminal court and international justice, where gathering evidence against political leaders protected by their state remains an enormous challenge. We hope the court can use the evidence it has gathered to support its case against the remaining perpetrators.”

Earlier this week, the UK charity Redress, which supports survivors of torture, criticised the court for failing to ensure Kenya cooperated. “Effectively, the court is saying: our powers to compel a state to cooperate with the ICC are limited so we will not even try,” said Carla Ferstman, director of Redress. “There should be real consequences for states who fail to cooperate with the court.