New York: Donald Trump's top national security adviser has launched a bellicose attack on the International Criminal Court, describing it as "fundamentally illegitimate" and "outright dangerous" in a speech that has alarmed human rights groups.

John Bolton threatened to prosecute judges from the International Criminal Court (ICC) or ban them from entering the United States if the organisation pursues an investigation into the conduct of American soldiers in Afghanistan.

"The United States will use any means necessary to protect our citizens and those of our allies from unjust prosecution by this illegitimate court," Bolton said in a speech to the Federalist Society, a conservative legal group, in Washington D.C on Monday US time.

"We will ban its judges and prosecutors from entering the United States.