TOKYO — North Korea said Tuesday that dialogue with the United States has been nothing but a “foolish trick” and warned Washington that it could be on the receiving end of an unwelcome Christmas gift.

The North Korean regime has given the United States until the end of the year to drop its “hostile policy,” come up with a new approach to talks and offer concessions in return for its decision to end nuclear and intercontinental ballistic missile (ICBM) tests in 2018.

Despite the tensions between the two countries, President Trump sounded an almost affectionate note about Kim Jong Un in London on Tuesday, expressing his confidence that North Korea would still denuclearize. But he also noted that the North Korean leader “likes sending rockets up, doesn’t he?”

“That’s why I call him Rocket Man,” Trump said.

Trump added that military action remains an option. “Hopefully we do not have to use it,” he said during remarks about North Korea. “But if we do, we will use it. If we have to, we will use it.”

Good personal relations between the two leaders and a recent decision by the United States to postpone joint air drills with South Korea, however, have clearly not been enough for Pyongyang.

Ri Thae Song, vice foreign minister in charge of U.S. affairs, accused Washington of trying to buy time by calling for a “sustained and substantial dialogue,” an approach he rejected.

“The dialogue touted by the U.S. is, in essence, nothing but a foolish trick hatched to keep the DPRK bound to dialogue and use it in favor of the political situation and election in the U.S.,” he said, referring to his country by the initials of its official name, the Democratic People’s Republic of Korea.

“The DPRK has heard more than enough dialogue rhetoric raised by the U.S. whenever it is driven into a tight corner,” Ri said. “So, no one will lend an ear to the U.S. any longer.”

Ri then again reminded the United States of the fast-approaching deadline, effectively repeating a veiled threat to resume long-range missile tests.

“The DPRK has done its utmost with maximum perseverance not to backtrack from the important steps it has taken on its own initiative,” he said in a statement carried by the North’s state-run Korean Central News Agency. “What is left to be done now is the U.S. option, and it is entirely up to the U.S. what Christmas gift it will select to get.”

North Korea has a history of timing launches with an eye on international developments and even U.S. holidays.

Last week, North Korea chose Thanksgiving Day to launch two projectiles from what it called a “super large multiple-rocket launcher,” marking the 14th test of short-range rockets or missiles it has undertaken this year.

On July 4, 2017, North Korea conducted its first test of an ICBM, the Hwasong-14, with leader Kim Jong Un describing it as a “gift package” for the Americans on their Independence Day.

North Korea has also dialed up the military threats in recent months, suggesting it may soon launch a ballistic missile in the direction of Japan.

When Japanese Prime Minister Shinzo Abe said last week’s launch was a threat to the region and the world and described the projectiles as ballistic missiles, North Korea responded by calling him the worst idiot in the world and the stupidest man in history.

“Abe may see what a real ballistic missile is in the not distant future and under his nose,” KCNA said Saturday. “Abe is none other than a perfect imbecile and a political dwarf.”

Min Joo Kim in Seoul contributed to this report.