The US president's remarks came against the backdrop of his ultimatum for Moscow to end its war in Ukraine.