The US president claimed that the court had engaged in ‘illegitimate and baseless actions’ against both countries.