LONDON — The International Criminal Court ruled on Thursday that its chief prosecutor could open an investigation into allegations of war crimes in Afghanistan including any that may have been committed by Americans, a step that infuriated the Trump administration.

The ruling by an appeals chamber of the court in The Hague reversed a lower chamber’s decision that had halted an inquiry into the behavior of forces from the United States, which does not recognize the court’s jurisdiction. Washington revoked the visa of the court’s chief prosecutor, Fatou Bensouda, last year after she had signaled her intentions to pursue the case.

The reversal of the lower chamber’s decision was widely viewed as a vindication of complaints by rights activists and legal scholars, who said that the lower chamber had buckled to intimidation by the Trump administration and had raised doubts about the court’s independence.

“The ICC Appeals Chamber’s decision to greenlight an investigation of brutal crimes in Afghanistan despite extreme pressure reaffirms the court’s essential role for victims when all other doors to justice are closed,” said Param-Preet Singh, the associate international justice director at Human Rights Watch.