WASHINGTON – The White House hailed Friday's decision by the International Criminal Court not to investigate Americans for alleged war crimes in Afghanistan, but included a warning to the ICC just in case.

"Any attempt to target American, Israel, or allied personnel for prosecution will be met with a swift and vigorous response," President Donald Trump said in a written statement.

Trump otherwise praised the ICC for refusing a prosecutor's request to investigate allegations of war crimes by U.S. military and intelligence personnel during the Afghanistan War.

Noting that the United States is not a member of the international court, and therefore it lacks jurisdiction over American citizens, Trump said that "the United States holds American citizens to the highest legal and ethical standards."

More:Pompeo: State Dept. bars war crimes court members from the U.S., citing torture probe

More:What's the International Criminal Court and why are countries bailing?

Trump and National Security Adviser John Bolton said the U.S. won't join the International Criminal Court because it is unaccountable and represented a threat to "American national sovereignty."

As for the warning, Bolton said that over time the ICC has threatened to prosecute U.S. and Israeli citizens, and that Trump wanted to remind the court that this would not be tolerated.

Friday's ruling was "a vindication of the president's support for American sovereignty," Bolton said.

Fatou Bensouda, chief prosecutor of the International Criminal Court, made a request in 2017 to open an investigation of alleged war crimes committed in Afghanistan.

Bensouda’s request said there was information members of U.S. military and intelligence agencies “committed acts of torture, cruel treatment, outrages upon personal dignity, rape and sexual violence against conflict-related detainees in Afghanistan and other locations, principally in the 2003-2004 period.”

In ruling against the prosecutor on Friday, a three-judge panel of the ICC said an investigation of actions in Afghanistan "would not serve the interests of justice" at this time.

Human Rights Watch criticized the ruling as “a devastating blow for victims who have suffered grave crimes without redress.”

Contributing: Associated Press