U.S. President Donald Trump on Sunday warned North Korean leader Kim Jong Un that he risks losing "everything" through hostility toward the United States, a day after Pyongyang said it had carried out a major new weapons test.

"Kim Jong Un is too smart and has far too much to lose, everything actually, if he acts in a hostile way. He signed a strong Denuclearization Agreement with me in Singapore," Trump wrote on Twitter, referring to his landmark first summit with Kim in Singapore last year.

"He does not want to void his special relationship with the President of the United States or interfere with the U.S. Presidential Election in November," he wrote.